]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/karma/rule_fail.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Hartmut Kaiser
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 =============================================================================*/
8 #include <boost/config/warning_disable.hpp>
9 #include <boost/spirit/include/karma_operator.hpp>
10 #include <boost/spirit/include/karma_char.hpp>
11 #include <boost/spirit/include/karma_numeric.hpp>
12 #include <boost/spirit/include/karma_nonterminal.hpp>
13 #include <boost/spirit/include/karma_generate.hpp>
14 #include <boost/function_output_iterator.hpp>
18 using namespace boost::spirit
;
19 using namespace boost::spirit::ascii
;
21 // this test must fail compiling as the rule is used with an incompatible
25 typedef spirit_test::output_iterator
<char>::type outiter_type
;
27 std::string generated
;
29 karma::rule
<outiter_type
, karma::rule
<outiter_type
> > def
;
30 def
= int_(1) << ',' << int_(0);
32 std::back_insert_iterator
<std::string
> outit(generated
);
33 generate_delimited(outit
, def
, char_('%') << '\n');