]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/karma/rule_fail.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / spirit / test / karma / rule_fail.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Hartmut Kaiser
3
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 =============================================================================*/
7
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>
15
16 #include "test.hpp"
17
18 using namespace boost::spirit;
19 using namespace boost::spirit::ascii;
20
21 // this test must fail compiling as the rule is used with an incompatible
22 // delimiter type
23 int main()
24 {
25 typedef spirit_test::output_iterator<char>::type outiter_type;
26
27 std::string generated;
28
29 karma::rule<outiter_type, karma::rule<outiter_type> > def;
30 def = int_(1) << ',' << int_(0);
31
32 std::back_insert_iterator<std::string> outit(generated);
33 generate_delimited(outit, def, char_('%') << '\n');
34
35 return 0;
36 }