• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  
2  #include <boost/parameter/name.hpp>
3  
4  BOOST_PARAMETER_NAME(graph)
5  BOOST_PARAMETER_NAME(visitor)
6  BOOST_PARAMETER_NAME(root_vertex)
7  BOOST_PARAMETER_NAME(index_map)
8  BOOST_PARAMETER_NAME(in_out(color_map))
9  
10  namespace boost {
11  
12      template <typename T = int>
13      struct dfs_visitor
14      {
15      };
16  
17      int vertex_index = 0;
18  }
19  
20  #include <boost/parameter/preprocessor.hpp>
21  
22  namespace graphs {
23  
24      BOOST_PARAMETER_FUNCTION(
25          (void),                // 1. parenthesized return type
26          depth_first_search,    // 2. name of the function template
27  
28          tag,                   // 3. namespace of tag types
29  
30          (required (graph, *) ) // 4. one required parameter, and
31  
32          (optional              //    four optional parameters, with defaults
33              (visitor,           *, boost::dfs_visitor<>())
34              (root_vertex,       *, *vertices(graph).first)
35              (index_map,         *, get(boost::vertex_index,graph))
36              (in_out(color_map), *,
37                  default_color_map(num_vertices(graph), index_map)
38              )
39          )
40      )
41      {
42          // ... body of function goes here...
43          // use graph, visitor, index_map, and color_map
44      }
45  }
46