read_propmap.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // (C) Copyright 2009 Dmitry Bufistov, 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. #include <boost/graph/graph_concepts.hpp>
  7. #include <boost/graph/adjacency_list.hpp>
  8. #include <boost/concept/assert.hpp>
  9. // Test contributed by Dmitry that validates a read-only property map bug
  10. // for bundled properties.
  11. // TODO: Integrate this into a testing framework.
  12. using namespace boost;
  13. struct EdgeProp
  14. {
  15. double weight;
  16. };
  17. typedef adjacency_list<vecS, vecS, directedS, no_property, EdgeProp > graph_t;
  18. int main()
  19. {
  20. typedef property_map<graph_t, double EdgeProp::*>::type WeightMap;
  21. typedef property_map<graph_t, double EdgeProp::*>::const_type cWeightMap;
  22. typedef graph_traits<graph_t>::edge_descriptor Edge;
  23. BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<WeightMap, Edge> ));
  24. BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept<cWeightMap, Edge> ));
  25. return 0;
  26. }