]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | #include <boost/parameter.hpp> | |
3 | #include <iostream> | |
7c673cae | 4 | |
92f5a8d4 TL |
5 | namespace lib { |
6 | ||
7 | BOOST_PARAMETER_NAME(name) | |
8 | BOOST_PARAMETER_NAME(index) | |
9 | ||
10 | BOOST_PARAMETER_FUNCTION( | |
11 | (int), f, tag, (optional (name,*,"bob")(index,(int),1)) | |
12 | ) | |
13 | { | |
14 | std::cout << name << ":" << index << std::endl; | |
15 | return index; | |
16 | } | |
17 | } | |
18 | ||
19 | #include <boost/core/lightweight_test.hpp> | |
20 | ||
21 | int main() | |
22 | { | |
23 | int x = lib::f(lib::_name = "jill", lib::_index = 1); | |
24 | BOOST_TEST_EQ(x, 1); | |
25 | return boost::report_errors(); | |
7c673cae | 26 | } |
7c673cae | 27 |