]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | ||
7c673cae FG |
8 | #include <boost/spirit/include/karma_operator.hpp> |
9 | #include <boost/spirit/include/karma_char.hpp> | |
10 | #include <boost/spirit/include/karma_numeric.hpp> | |
11 | #include <boost/spirit/include/karma_nonterminal.hpp> | |
12 | #include <boost/spirit/include/karma_generate.hpp> | |
7c673cae FG |
13 | |
14 | #include "test.hpp" | |
15 | ||
16 | using namespace boost::spirit; | |
17 | using namespace boost::spirit::ascii; | |
18 | ||
19 | // this test must fail compiling as the rule is used with an incompatible | |
20 | // delimiter type | |
21 | int main() | |
22 | { | |
23 | typedef spirit_test::output_iterator<char>::type outiter_type; | |
24 | ||
25 | std::string generated; | |
26 | ||
27 | karma::rule<outiter_type, karma::rule<outiter_type> > def; | |
28 | def = int_(1) << ',' << int_(0); | |
29 | ||
30 | std::back_insert_iterator<std::string> outit(generated); | |
31 | generate_delimited(outit, def, char_('%') << '\n'); | |
32 | ||
33 | return 0; | |
34 | } |