2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00
Files
spirit/test/karma/rule_fail.cpp
Nikita Kniazev f44479bcd3 Remove boost/config/warning_disable.hpp usage
It is better to manage warnings on our side to know what warnings we need to fix or suppress, and the only thing that header does is disabling deprecation warnings on MSVC and ICC which we would prefer to not show to users.
2021-08-24 03:14:12 +03:00

35 lines
1.1 KiB
C++

/*=============================================================================
Copyright (c) 2001-2011 Hartmut Kaiser
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#include <boost/spirit/include/karma_operator.hpp>
#include <boost/spirit/include/karma_char.hpp>
#include <boost/spirit/include/karma_numeric.hpp>
#include <boost/spirit/include/karma_nonterminal.hpp>
#include <boost/spirit/include/karma_generate.hpp>
#include "test.hpp"
using namespace boost::spirit;
using namespace boost::spirit::ascii;
// this test must fail compiling as the rule is used with an incompatible
// delimiter type
int main()
{
typedef spirit_test::output_iterator<char>::type outiter_type;
std::string generated;
karma::rule<outiter_type, karma::rule<outiter_type> > def;
def = int_(1) << ',' << int_(0);
std::back_insert_iterator<std::string> outit(generated);
generate_delimited(outit, def, char_('%') << '\n');
return 0;
}