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: laszlo.szakony@… 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 Douglas Gregor, 14 years ago

Milestone: Boost 1.36.0Boost 1.37.0
Status: newassigned

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).

comment:2 by Jeremiah Willcock, 13 years ago

Owner: changed from Douglas Gregor to Jeremiah Willcock
Status: assignednew

Have you tried the property_map specialization workaround suggested by Doug? If so, does it work?

comment:3 by Jeremiah Willcock, 13 years ago

Status: newassigned

comment:4 by Jeremiah Willcock, 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 Jeremiah Willcock, 13 years ago

Resolution: fixed
Status: assignedclosed

(In [57902]) Fixed uses of undocumented members of graph types; fixes #1021; fixes #2072

Note: See TracTickets for help on using tickets.