]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/parameter/test/literate/extracting-parameter-types0.cpp
2 #include <boost/parameter.hpp>
4 BOOST_PARAMETER_NAME(name
)
5 BOOST_PARAMETER_NAME(index
)
8 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
16 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
20 template <typename Name
, typename Index
>
21 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
22 int deduce_arg_types_impl(Name
&& name
, Index
&& index
)
24 noop(std::forward
<Name
>(name
));
25 noop(std::forward
<Index
>(index
));
29 int deduce_arg_types_impl(Name
& name
, Index
& index
)
31 Name
& n2
= name
; // we know the types
39 template <typename ArgumentPack
>
40 int deduce_arg_types(ArgumentPack
const& args
)
42 return deduce_arg_types_impl(args
[_name
], args
[_index
|42]);
45 #include <boost/core/lightweight_test.hpp>
49 int a1
= deduce_arg_types((_name
= "foo"));
50 int a2
= deduce_arg_types((_name
= "foo", _index
= 3));
51 BOOST_TEST_EQ(a1
, 42);
53 return boost::report_errors();