1 //=======================================================================
2 // Copyright 2001 Jeremy G. Siek, Andrew Lumsdaine, Lie-Quan Lee,
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //=======================================================================
8 #include <boost/config.hpp>
10 #include <boost/graph/adjacency_list.hpp>
11 #include <boost/graph/graph_utility.hpp>
13 using namespace boost
;
15 template < typename T
>
16 std::istream
& operator >> (std::istream
& in
, std::pair
< T
, T
> &p
) {
17 in
>> p
.first
>> p
.second
;
23 main(int argc
, const char** argv
)
25 typedef adjacency_list
<
26 listS
, // Store out-edges of each vertex in a std::list
27 vecS
, // Store vertex set in a std::vector
28 directedS
// The graph is directed
31 std::ifstream
file_in(argc
>= 2 ? argv
[1] : "makefile-dependencies.dat");
32 typedef graph_traits
< graph_type
>::vertices_size_type size_type
;
34 file_in
>> n_vertices
; // read in number of vertices
37 g(n_vertices
); // create graph with n vertices
40 graph_traits
< graph_type
>::vertices_size_type u
, v
;
47 assert(num_vertices(g
) == 15);
48 assert(num_edges(g
) == 19);