mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
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.
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
// Copyright (c) 2010 Josh Wilson
|
|
// Copyright (c) 2001-2010 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/qi.hpp>
|
|
#include <boost/fusion/include/adapt_struct.hpp>
|
|
#include <boost/variant.hpp>
|
|
#include <string>
|
|
|
|
namespace qi = boost::spirit::qi;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
struct Number { float base; };
|
|
|
|
BOOST_FUSION_ADAPT_STRUCT( Number, (float, base) )
|
|
|
|
void instantiate1()
|
|
{
|
|
qi::symbols<char, Number> sym;
|
|
qi::rule<std::string::const_iterator, Number()> rule;
|
|
rule %= sym; // Caused compiler error after getting r61322
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
typedef boost::variant<int, float> internal_type;
|
|
|
|
struct Number2 { internal_type base; };
|
|
|
|
BOOST_FUSION_ADAPT_STRUCT( Number2, (internal_type, base) )
|
|
|
|
void instantiate2()
|
|
{
|
|
qi::symbols<char, Number2> sym;
|
|
qi::rule<std::string::const_iterator, Number2()> rule;
|
|
rule %= sym; // Caused compiler error after getting r61322
|
|
}
|
|
|