optional-parameters0.cpp 661 B

123456789101112131415161718192021222324252627282930313233
  1. #include <boost/parameter.hpp>
  2. namespace boost {
  3. int vertex_index = 0;
  4. template <typename T = int>
  5. struct dfs_visitor
  6. {
  7. };
  8. }
  9. BOOST_PARAMETER_NAME(graph)
  10. BOOST_PARAMETER_NAME(visitor)
  11. BOOST_PARAMETER_NAME(root_vertex)
  12. BOOST_PARAMETER_NAME(index_map)
  13. BOOST_PARAMETER_NAME(in_out(color_map))
  14. BOOST_PARAMETER_FUNCTION((void), f, tag,
  15. (required (graph, *))
  16. (optional
  17. (visitor, *, boost::dfs_visitor<>())
  18. (root_vertex, *, *vertices(graph).first)
  19. (index_map, *, get(boost::vertex_index,graph))
  20. (color_map, *,
  21. default_color_map(num_vertices(graph), index_map)
  22. )
  23. )
  24. )
  25. {
  26. }