`depth_first_visit_impl`: `finish_edge` not invoked when it should on MSVC
@jeremy-murphy is already working on this.
Since Nov 6, 2023.
Assessment
This issue has not been assessed yet.
Description
Lines 94-104 in depth_first_search.hpp:
template < typename E, typename G, typename Vis >
void call_finish_edge(Vis& vis, E e, const G& g)
{ // Only call if method exists
#if ((defined(__GNUC__) && (__GNUC__ > 4) \
|| ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))) \
|| defined(__clang__) \
|| (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1200)))
do_call_finish_edge< has_member_function_finish_edge< Vis, void,
boost::mpl::vector< E, const G& > >::value >::call_finish_edge(vis,
e, g);
#else
do_call_finish_edge< has_member_function_finish_edge< Vis,
void >::value >::call_finish_edge(vis, e, g);
#endif
}
On MSVC, the section after the #else will not call Vis::finish_edge even when it is available and has the correct signature because has_member_function_finish_edge<Vis, void>::value is false. I think this is because instead of checking that Vis::finish_edge exists and has return type void as was seemingly intended, it in facts checks that it has the exact signature void(). So on MSVC, even when providing a visitor type with a correct void finish_edge(E, const G&), it is never called.
I don't know how to fix this because I don't know why it was determined that some compilers should be treated differently here.
I circumvented the bug in my code by adding a dummy void finish_edge() {} member function in my visitor type next to the actual void finish_edge(E, const G&) function just so the member function detection would yield true.
Alternatively this could be a bug in boost/tti/has_member_function.hpp but I guess that's less likely.
- Dominant language
- C++
- Stars
- 395
- Forks
- 239
- Avg merge
- 18h 50m
- Merged PRs (30d)
- 20
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/graph
-
beginner friendly
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
algorithm beginner friendly priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
priority: high warning
-
algorithm
boostorg/graph#493 · 22 comments · 1 reaction · 2 assignees ·
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·