graph_concepts.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //=======================================================================
  2. // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
  3. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //=======================================================================
  9. #include <boost/graph/graph_concepts.hpp>
  10. #include <boost/graph/graph_archetypes.hpp>
  11. #include <boost/concept/assert.hpp>
  12. int main(int,char*[])
  13. {
  14. using namespace boost;
  15. // Check graph concepts againt their archetypes
  16. typedef default_constructible_archetype<
  17. sgi_assignable_archetype< equality_comparable_archetype<> > > Vertex;
  18. typedef incidence_graph_archetype<Vertex, directed_tag,
  19. allow_parallel_edge_tag> Graph1;
  20. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph1> ));
  21. typedef adjacency_graph_archetype<Vertex, directed_tag,
  22. allow_parallel_edge_tag> Graph2;
  23. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph2> ));
  24. typedef vertex_list_graph_archetype<Vertex, directed_tag,
  25. allow_parallel_edge_tag> Graph3;
  26. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph3> ));
  27. BOOST_CONCEPT_ASSERT(( ColorValueConcept<color_value_archetype> ));
  28. typedef incidence_graph_archetype<Vertex, directed_tag, allow_parallel_edge_tag> G;
  29. typedef property_graph_archetype<G, vertex_color_t, color_value_archetype>
  30. Graph4;
  31. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph4, Vertex, vertex_color_t> ));
  32. return 0;
  33. }