Ticket #4245: demo.cpp

File demo.cpp, 493 bytes (added by Christopher Alfeld <alfeld@…>, 12 years ago)

Program to demonstrate problems -- throws std::length_error.

Line 
1#include <boost/graph/adjacency_list.hpp>
2#include <boost/property_map/property_map.hpp>
3#include <boost/graph/graphml.hpp>
4#include <iostream>
5
6using namespace std;
7
8typedef boost::adjacency_list<> graph_t;
9
10int main(int,char**)
11{
12 string empty_string;
13 boost::ref_property_map<
14 graph_t::vertex_descriptor,
15 string
16 > pmap(empty_string);
17 graph_t g;
18
19 add_vertex(g);
20
21 boost::dynamic_properties props;
22 props.property("foo",pmap);
23
24 boost::write_graphml(cout,g,props);
25}