]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/spirit/test/karma/lazy.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / spirit / test / karma / lazy.cpp
CommitLineData
7c673cae
FG
1// Copyright (c) 2001-2011 Hartmut Kaiser
2//
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
1e59de90
TL
6#include <boost/spirit/include/karma_lazy.hpp>
7
7c673cae
FG
8#include <boost/spirit/include/karma_char.hpp>
9#include <boost/spirit/include/karma_string.hpp>
10#include <boost/spirit/include/karma_numeric.hpp>
11#include <boost/spirit/include/karma_auxiliary.hpp>
12#include <boost/spirit/include/karma_action.hpp>
13// #include <boost/spirit/include/karma_nonterminal.hpp>
14// #include <boost/spirit/include/karma_operator.hpp>
15#include <boost/spirit/include/support_argument.hpp>
1e59de90
TL
16#include <boost/phoenix/core.hpp>
17#include <boost/phoenix/operator.hpp>
7c673cae
FG
18
19#include <iostream>
20#include "test.hpp"
21
22int
23main()
24{
25 namespace karma = boost::spirit::karma;
26 using spirit_test::test;
27 using namespace boost::spirit;
28 using namespace boost::spirit::karma;
29 namespace phx = boost::phoenix;
30
31 {
32 BOOST_TEST(test("123", karma::lazy(phx::val(int_)), 123));
33 }
34
35 {
36 int result = 123;
37 BOOST_TEST(test("123", karma::lazy(phx::val(int_))[_1 = phx::ref(result)]));
38 }
39
40// {
41// typedef spirit_test::output_iterator<char>::type outiter_type;
42// rule<outiter_type, void(std::string)> r;
43//
44// r = char_('<') << karma::lazy(_r1) << '>' << "</" << karma::lazy(_r1) << '>';
45//
46// std::string tag("tag"), foo("foo");
47// BOOST_TEST(test("<tag></tag>", r (phx::ref(tag))));
48// BOOST_TEST(!test("<foo></bar>", r (phx::ref(foo))));
49// }
50
51 return boost::report_errors();
52}