• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <boost/detail/lightweight_test.hpp>
12 
13 #define PHOENIX_LIMIT 15
14 #include <boost/spirit/include/phoenix1_primitives.hpp>
15 #include <boost/spirit/include/phoenix1_new.hpp>
16 
17 using namespace phoenix;
18 using namespace std;
19 
20 class X
21 {
22 public:
X(int i_=1)23     X(int i_ = 1)
24     :   i(i_)
25     {}
26 
27     int i;
28 };
29 
30 ///////////////////////////////////////////////////////////////////////////////
31 int
main()32 main()
33 {
34     int i2 = 2;
35     X   x3(3);
36 
37     BOOST_TEST(new_<int>()() != NULL);
38     BOOST_TEST(*new_<int>(arg1)(i2) == 2);
39 
40     BOOST_TEST(new_<X>()() != NULL);
41     BOOST_TEST(new_<X>()()->i == 1);
42     BOOST_TEST(new_<X>(arg1)(i2)->i == 2);
43     BOOST_TEST(new_<X>(arg1)(x3)->i == 3);
44 
45     return boost::report_errors();
46 }
47