Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/spirit/phoenix/test/primitives_tests.cpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.3 KB
Line 
1/*=============================================================================
2    Phoenix V1.2.1
3    Copyright (c) 2001-2003 Joel de Guzman
4
5    Use, modification and distribution is subject to the Boost Software
6    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7    http://www.boost.org/LICENSE_1_0.txt)
8==============================================================================*/
9#include <iostream>
10#include <boost/detail/lightweight_test.hpp>
11
12#define PHOENIX_LIMIT 15
13#include <boost/spirit/phoenix/primitives.hpp>
14
15using namespace phoenix;
16using namespace std;
17
18///////////////////////////////////////////////////////////////////////////////
19int
20main()
21{
22    char c1 = '1';
23    int i1 = 1, i2 = 2, i = 4;
24    const char* s2 = "2";
25
26///////////////////////////////////////////////////////////////////////////////
27//
28//  Values, variables and arguments
29//
30///////////////////////////////////////////////////////////////////////////////
31    cout << val("Hello")() << val(' ')() << val("World")() << endl;
32
33    BOOST_TEST(arg1(c1) == c1);
34    BOOST_TEST(arg1(i1, i2) == i1);
35    BOOST_TEST(arg2(i1, s2) == s2);
36
37    BOOST_TEST(val(3)() == 3);
38    BOOST_TEST(var(i)() == 4);
39    BOOST_TEST(var(++i)() == 5);
40
41    return boost::report_errors();   
42}
Note: See TracBrowser for help on using the repository browser.