]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/phoenix/test/new_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / spirit / classic / phoenix / test / new_test.cpp
1 /*=============================================================================
2 Phoenix V1.2.1
3 Copyright (c) 2001-2003 Joel de Guzman
4 Copyright (c) 2003 Vaclav Vesely
5
6 Use, modification and distribution is subject to the Boost Software
7 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 http://www.boost.org/LICENSE_1_0.txt)
9 ==============================================================================*/
10 #include <iostream>
11
12 #define PHOENIX_LIMIT 15
13 #include <boost/spirit/include/phoenix1_primitives.hpp>
14 #include <boost/spirit/include/phoenix1_new.hpp>
15
16 #include <boost/core/lightweight_test.hpp>
17
18 using namespace phoenix;
19 using namespace std;
20
21 class X
22 {
23 public:
24 X(int i_ = 1)
25 : i(i_)
26 {}
27
28 int i;
29 };
30
31 ///////////////////////////////////////////////////////////////////////////////
32 int
33 main()
34 {
35 int i2 = 2;
36 X x3(3);
37
38 BOOST_TEST(new_<int>()() != NULL);
39 BOOST_TEST(*new_<int>(arg1)(i2) == 2);
40
41 BOOST_TEST(new_<X>()() != NULL);
42 BOOST_TEST(new_<X>()()->i == 1);
43 BOOST_TEST(new_<X>(arg1)(i2)->i == 2);
44 BOOST_TEST(new_<X>(arg1)(x3)->i == 3);
45
46 return boost::report_errors();
47 }