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