]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | #include <boost/parameter.hpp> | |
7c673cae | 3 | |
7c673cae FG |
4 | BOOST_PARAMETER_NAME(index) |
5 | ||
92f5a8d4 TL |
6 | template <typename ArgumentPack> |
7 | typename boost::parameter::value_type<ArgumentPack,tag::index,int>::type | |
8 | twice_index(ArgumentPack const& args) | |
7c673cae FG |
9 | { |
10 | return 2 * args[_index|42]; | |
11 | } | |
12 | ||
92f5a8d4 TL |
13 | #include <boost/core/lightweight_test.hpp> |
14 | ||
7c673cae FG |
15 | int main() |
16 | { | |
92f5a8d4 TL |
17 | int six = twice_index(_index = 3); |
18 | BOOST_TEST_EQ(six, 6); | |
19 | return boost::report_errors(); | |
7c673cae FG |
20 | } |
21 |