]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/parameter/test/literate/lazy-default-computation0.cpp
2 #include <boost/parameter.hpp>
5 BOOST_PARAMETER_NAME(s1
)
6 BOOST_PARAMETER_NAME(s2
)
7 BOOST_PARAMETER_NAME(s3
)
9 template <typename ArgumentPack
>
10 std::string
f(ArgumentPack
const& args
)
12 std::string
const& s1
= args
[_s1
];
13 std::string
const& s2
= args
[_s2
];
14 typename
boost::parameter::binding
<
15 ArgumentPack
,tag::s3
,std::string
16 >::type s3
= args
[_s3
|(s1
+s2
)]; // always constructs s1+s2
20 #include <boost/core/lightweight_test.hpp>
24 std::string x
= f((_s1
="hello,", _s2
=" world", _s3
="hi world"));
25 BOOST_TEST_EQ(x
, std::string("hi world"));
26 return boost::report_errors();