graph_property.cpp 870 B

1234567891011121314151617181920212223242526272829303132333435
  1. // (C) Copyright Jeremy Siek 2004
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <string>
  6. #include <iostream>
  7. #include <boost/cstdlib.hpp>
  8. #include <boost/graph/adjacency_list.hpp>
  9. #include <boost/graph/subgraph.hpp>
  10. int
  11. main()
  12. {
  13. using namespace boost;
  14. using std::string;
  15. typedef adjacency_list<vecS, vecS, directedS,no_property,
  16. property<edge_index_t, int>,
  17. property<graph_name_t, string> > graph_t;
  18. graph_t g;
  19. get_property(g, graph_name) = "graph";
  20. std::cout << "name: " << get_property(g, graph_name) << std::endl;
  21. typedef subgraph<graph_t> subgraph_t;
  22. subgraph_t sg;
  23. get_property(sg, graph_name) = "subgraph";
  24. std::cout << "name: " << get_property(sg, graph_name) << std::endl;
  25. return exit_success;
  26. }