Opened 14 years ago
Closed 13 years ago
#2072 closed Bugs (fixed)
Default named parameters in the graph library can not be used with external adaptet graph libraries
Reported by: | Owned by: | Jeremiah Willcock | |
---|---|---|---|
Milestone: | Boost 1.37.0 | Component: | graph |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Due to the following code in boost/graph/properties.hpp:154,155 typedef typename Graph::graph_tag graph_tag; default named paramters can not be used in external libraries, where 'Graph' does not have a graph_tag type. I tested with depth_first_search(). If the code would change to typedef typename graph_traits<Graph>::graph_tag graph_tag; then would be OK. But if I change the line above I get other error messages.
Change History (5)
comment:1 by , 14 years ago
Milestone: | Boost 1.36.0 → Boost 1.37.0 |
---|---|
Status: | new → assigned |
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
Have you tried the property_map specialization workaround suggested by Doug? If so, does it work?
comment:3 by , 13 years ago
Status: | new → assigned |
---|
comment:4 by , 13 years ago
Wouldn't the first two tests in libs/graph/test/dfs_cc.cpp catch this kind of problem? Could you please post an example program that demonstrates the bug?
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This is definitely a bug, but the fix isn't to use graph_traits. Rather, we need to avoid getting into this part of the code that attempts to look at graph_tag. The general fix is to not define a primary property_map template that looks into the graph type itself unless we know that graph_tag will be there.
The workaround is to define a partial specialization of boost::property_map for your graph type, so that the primary property_map template is never used (and, therefore, we don't end up looking for graph_tag).