• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #include <boost/parameter.hpp>
3 #include <iostream>
4 
5 namespace lib {
6     namespace keywords {
7 
8         BOOST_PARAMETER_NAME(name)
9         BOOST_PARAMETER_NAME(index)
10     }
11 
12     BOOST_PARAMETER_FUNCTION(
13         (int), f, keywords::tag, (optional (name,*,"bob")(index,(int),1))
14     )
15     {
16         std::cout << name << ":" << index << std::endl;
17         return index;
18     }
19 }
20 
21 #include <boost/core/lightweight_test.hpp>
22 
23 using namespace lib::keywords;
24 
main()25 int main()
26 {
27     int x = lib::f(_name = "bob", _index = 2);
28     BOOST_TEST_EQ(x, 2);
29     return boost::report_errors();
30 }
31 
32