mirror of
https://github.com/boostorg/graph.git
synced 2025-05-09 23:14:00 +00:00
Merge pull request #415 from AnthonyVH/anthonyvh/fix_named_graph_copy
Ensure named_graph base class is initialized before accessing it
This commit is contained in:
commit
cbb91297ca
@ -267,18 +267,21 @@ template < class OutEdgeListS = vecS, // a Sequence or an AssociativeContainer
|
||||
class EdgeProperty = no_property, class GraphProperty = no_property,
|
||||
class EdgeListS = listS >
|
||||
class adjacency_list
|
||||
: public detail::adj_list_gen<
|
||||
adjacency_list< OutEdgeListS, VertexListS, DirectedS, VertexProperty,
|
||||
EdgeProperty, GraphProperty, EdgeListS >,
|
||||
VertexListS, OutEdgeListS, DirectedS, VertexProperty, EdgeProperty,
|
||||
GraphProperty, EdgeListS >::type,
|
||||
// Support for named vertices
|
||||
: // Support for named vertices
|
||||
// This needs to be inherited from first to ensure it's initialized before the
|
||||
// "base" (i.e. detail::adj_list_gen), because the "base" might indirectly
|
||||
// call functions on it during its construction.
|
||||
public graph::maybe_named_graph<
|
||||
adjacency_list< OutEdgeListS, VertexListS, DirectedS, VertexProperty,
|
||||
EdgeProperty, GraphProperty, EdgeListS >,
|
||||
typename adjacency_list_traits< OutEdgeListS, VertexListS, DirectedS,
|
||||
EdgeListS >::vertex_descriptor,
|
||||
VertexProperty >
|
||||
VertexProperty >,
|
||||
public detail::adj_list_gen<
|
||||
adjacency_list< OutEdgeListS, VertexListS, DirectedS, VertexProperty,
|
||||
EdgeProperty, GraphProperty, EdgeListS >,
|
||||
VertexListS, OutEdgeListS, DirectedS, VertexProperty, EdgeProperty,
|
||||
GraphProperty, EdgeListS >::type
|
||||
{
|
||||
public:
|
||||
typedef GraphProperty graph_property_type;
|
||||
|
@ -91,5 +91,8 @@ int main(int, char*[])
|
||||
|
||||
BOOST_TEST(map[*find_vertex("Cincinnatti", map)].population == -1);
|
||||
|
||||
// Ensure copy constructor properly initializes base classes.
|
||||
BOOST_TEST_NO_THROW(RoadMap{map});
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user