]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/parameter/test/macros.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / parameter / test / macros.cpp
CommitLineData
7c673cae
FG
1// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
2// distribution is subject to the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5
6#include <boost/parameter.hpp>
7#include <boost/parameter/macros.hpp>
8#include <boost/bind.hpp>
9#include <boost/static_assert.hpp>
10#include <boost/ref.hpp>
11#include <cassert>
12#include <string.h>
13
14#include "basics.hpp"
15
16namespace test
17{
18
19 BOOST_PARAMETER_FUN(int, f, 2, 4, f_parameters)
20 {
21 p[tester](
22 p[name]
23 , p[value || boost::bind(&value_default) ]
24#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
25 , p[test::index | 999 ]
26#else
27 , p[index | 999 ]
28#endif
29 );
30
31 return 1;
32 }
33
34} // namespace test
35
36int main()
37{
38 using test::f;
39 using test::name;
40 using test::value;
41 using test::index;
42 using test::tester;
43
44 f(
45 test::values(S("foo"), S("bar"), S("baz"))
46 , S("foo"), S("bar"), S("baz")
47 );
48
49 int x = 56;
50 f(
51 test::values("foo", 666.222, 56)
52 , index = boost::ref(x), name = "foo"
53 );
54
55 return 0;
56}
57