| 1 | // Copyright David Abrahams 2005. |
| 2 | // Distributed under the Boost Software License, Version 1.0. |
| 3 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 4 | // http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | #include <boost/parameter/name.hpp> |
| 7 | |
| 8 | namespace graphs { |
| 9 | |
| 10 | BOOST_PARAMETER_NAME(graph) // Note: no semicolon |
| 11 | BOOST_PARAMETER_NAME(visitor) |
| 12 | BOOST_PARAMETER_NAME(root_vertex) |
| 13 | BOOST_PARAMETER_NAME(index_map) |
| 14 | BOOST_PARAMETER_NAME(color_map) |
| 15 | } // namespace graphs |
| 16 | |
| 17 | #include <boost/core/lightweight_test.hpp> |
| 18 | |
| 19 | namespace graphs { namespace core { |
| 20 | |
| 21 | template <typename ArgumentPack> |
| 22 | void depth_first_search(ArgumentPack const& args) |
| 23 | { |
| 24 | BOOST_TEST_EQ(false, args[_color_map]); |
| 25 | BOOST_TEST_EQ('G', args[_graph]); |
| 26 | BOOST_TEST_CSTR_EQ("hello, world" , args[_index_map]); |
| 27 | BOOST_TEST_EQ(3.5, args[_root_vertex]); |
| 28 | BOOST_TEST_EQ(2, args[_visitor]); |
| 29 | } |
| 30 | }} // namespace graphs::core |
| 31 | |
| 32 | int main() |
| 33 | { |
| 34 | using namespace graphs; |
| 35 | |
| 36 | core::depth_first_search(args: ( |
| 37 | _graph = 'G', _visitor = 2, _root_vertex = 3.5 |
| 38 | , _index_map = "hello, world" , _color_map = false |
| 39 | )); |
| 40 | return boost::report_errors(); |
| 41 | } |
| 42 | |