Ticket #4793: copy_component_kaput.cpp

File copy_component_kaput.cpp, 519 bytes (added by Christopher Alfeld <calfeld@…>, 12 years ago)

Simple test.

Line 
1#include <boost/graph/adjacency_list.hpp>
2#include <boost/graph/copy.hpp>
3#include <cassert>
4
5using namespace std;
6
7int main(int,char**)
8{
9 typedef boost::adjacency_list<> g_t;
10 typedef g_t::vertex_descriptor vd;
11 typedef g_t::edge_descriptor ed;
12
13 g_t G,H;
14
15 vd a = add_vertex(G);
16 vd b = add_vertex(G);
17 ed ab = add_edge(a,b,G).first;
18
19 assert( target(ab,G) == b );
20
21 vd a_copy = copy_component( G, a, H );
22 ed ab_copy = *out_edges( a_copy, H ).first;
23
24 assert( target(ab_copy,H) != a_copy );
25}
26