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