]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/parameter/test/maybe.cpp
1 // Copyright Daniel Wallin 2006. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <boost/parameter/keyword.hpp>
6 #include <boost/parameter/aux_/maybe.hpp>
11 BOOST_PARAMETER_KEYWORD(tag
, kw
)
12 BOOST_PARAMETER_KEYWORD(tag
, unused
)
15 int f(Args
const& args
)
17 return args
[kw
| 1.f
];
27 using boost::parameter::aux::maybe
;
29 assert(f((kw
= 0, unused
= 0)) == 0);
30 assert(f(unused
= 0) == 1);
31 assert(f((kw
= maybe
<int>(), unused
= 0)) == 1);
32 assert(f((kw
= maybe
<int>(2), unused
= 0)) == 2);