]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // (C) Copyright 2009 Andrew Sutton |
2 | // | |
3 | // Use, modification and distribution are subject to the | |
4 | // Boost Software License, Version 1.0 (See accompanying file | |
5 | // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
92f5a8d4 TL |
7 | /* |
8 | IMPORTANT!!! | |
9 | ~~~~~~~~~~~~ | |
10 | ||
11 | This example does not compile, see https://github.com/boostorg/graph/issues/147 | |
12 | ||
13 | */ | |
14 | ||
7c673cae FG |
15 | #include <iostream> |
16 | #include <string> | |
17 | ||
18 | #include <boost/graph/directed_graph.hpp> | |
19 | #include <boost/graph/labeled_graph.hpp> | |
20 | ||
21 | using namespace boost; | |
22 | using namespace std; | |
23 | ||
24 | int main() { | |
25 | ||
26 | using namespace boost::graph_detail; | |
27 | ||
28 | typedef directed_graph<> Digraph; | |
29 | ||
30 | { | |
31 | typedef labeled_graph<Digraph, unsigned> Graph; | |
32 | Graph g; | |
33 | add_vertex(1, g); | |
34 | add_vertex(2, g); | |
35 | ||
36 | Graph h(12); | |
37 | } | |
38 | ||
39 | { | |
40 | typedef labeled_graph<Digraph, string> Graph; | |
41 | Graph g; | |
42 | add_vertex("foo", g); | |
43 | add_vertex("bar", g); | |
44 | } | |
45 | ||
46 | { | |
47 | typedef labeled_graph<Digraph, string, mapS> Graph; | |
48 | Graph g; | |
49 | add_vertex("foo", g); | |
50 | add_vertex("bar", g); | |
51 | add_vertex("foo", g); | |
52 | } | |
53 | ||
54 | { | |
55 | typedef labeled_graph<Digraph*, int> TempGraph; | |
56 | Digraph g; | |
57 | TempGraph h(&g); | |
58 | add_vertex(12, h); | |
59 | } | |
60 | ||
61 | ||
62 | { | |
63 | // This is actually a fairly complicated specialization. | |
64 | typedef adjacency_list<vecS, vecS, bidirectionalS> G; | |
65 | typedef labeled_graph<G, size_t> Graph; | |
66 | Graph g; | |
67 | add_vertex(0, g); | |
68 | add_vertex(1, g); | |
69 | g.add_edge(0, 1); | |
70 | } | |
71 | ||
72 | ||
73 | return 0; | |
74 | } |