]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/qi/regression_one_element_sequence_attribute.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / spirit / test / qi / regression_one_element_sequence_attribute.cpp
1 // Copyright (c) 2010 Josh Wilson
2 // Copyright (c) 2001-2010 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 #include <boost/config/warning_disable.hpp>
8 #include <boost/spirit/include/qi.hpp>
9 #include <boost/fusion/include/adapt_struct.hpp>
10 #include <boost/variant.hpp>
11 #include <string>
12
13 namespace qi = boost::spirit::qi;
14
15 ///////////////////////////////////////////////////////////////////////////////
16 struct Number { float base; };
17
18 BOOST_FUSION_ADAPT_STRUCT( Number, (float, base) )
19
20 void instantiate1()
21 {
22 qi::symbols<char, Number> sym;
23 qi::rule<std::string::const_iterator, Number()> rule;
24 rule %= sym; // Caused compiler error after getting r61322
25 }
26
27 ///////////////////////////////////////////////////////////////////////////////
28 typedef boost::variant<int, float> internal_type;
29
30 struct Number2 { internal_type base; };
31
32 BOOST_FUSION_ADAPT_STRUCT( Number2, (internal_type, base) )
33
34 void instantiate2()
35 {
36 qi::symbols<char, Number2> sym;
37 qi::rule<std::string::const_iterator, Number2()> rule;
38 rule %= sym; // Caused compiler error after getting r61322
39 }
40