Boost C++ Libraries: Ticket #13093: boost_1_41_0 and qi compiler error https://svn.boost.org/trac10/ticket/13093 <p> Does anyone know how to fix the following errors? They are the same type and come up with 1_41 version. whereas with 1_53, it just compiles and run fine. </p> <p> I need this to worked with 1_41. The code and detail files are attached. </p> <p> 1) rule.cpp:36:14: required from ‘json::Grammar&lt;Iterator&gt;::Grammar() [with Iterator = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]’ rule.cpp:54:47: required from here ./boost_1_41_0/boost/spirit/home/support/attributes.hpp:409:70: error: no matching function for call to ‘std::map&lt;std::basic_string&lt;char&gt;, boost::any&gt;::map(boost::any&amp;)’ </p> <blockquote> <p> static Transformed pre(Exposed&amp; val) { return Transformed(val); } </p> </blockquote> <p> 2) rule.cpp:36:14: required from ‘json::Grammar&lt;Iterator&gt;::Grammar() [with Iterator = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]’ rule.cpp:54:47: required from here ./boost_1_41_0/boost/spirit/home/support/attributes.hpp:409:70: error: no matching function for call to ‘std::vector&lt;boost::any&gt;::vector(boost::any&amp;)’ </p> <blockquote> <p> static Transformed pre(Exposed&amp; val) { return Transformed(val); } </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> 3) rule.cpp:36:14: required from ‘json::Grammar&lt;Iterator&gt;::Grammar() [with Iterator = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]’ rule.cpp:54:47: required from here ./boost_1_41_0/boost/spirit/home/support/attributes.hpp:409:70: error: no matching function for call to ‘std::basic_string&lt;char&gt;::basic_string(boost::any&amp;)’ </p> <blockquote> <p> static Transformed pre(Exposed&amp; val) { return Transformed(val); } </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13093 Trac 1.4.3 anonymous Fri, 23 Jun 2017 17:13:12 GMT attachment set https://svn.boost.org/trac10/ticket/13093 https://svn.boost.org/trac10/ticket/13093 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">rule.cpp</span> </li> </ul> Ticket anonymous Fri, 23 Jun 2017 17:13:52 GMT attachment set https://svn.boost.org/trac10/ticket/13093 https://svn.boost.org/trac10/ticket/13093 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">report.log</span> </li> </ul> Ticket anonymous Fri, 23 Jun 2017 17:17:54 GMT <link>https://svn.boost.org/trac10/ticket/13093#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13093#comment:1</guid> <description> <pre class="wiki">source code in case you dont want to download the cpp- #include &lt;boost/any.hpp&gt; #include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;boost/fusion/adapted/std_pair.hpp&gt; #include &lt;boost/fusion/adapted/boost_tuple.hpp&gt; #include &lt;vector&gt; #include &lt;map&gt; #include &lt;iostream&gt; namespace json { namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; struct nullptr_t_ : qi::symbols&lt; char, void * &gt; { nullptr_t_() { add( "null", NULL ); } } nullptr_; typedef std::map&lt;std::string, boost::any&gt; map_any; typedef std::vector&lt;boost::any&gt; vector_any; typedef std::pair&lt;std::string, boost::any&gt; pair_any; template&lt; typename Iterator &gt; struct Grammar : qi::grammar&lt; Iterator, boost::any(), ascii::space_type &gt; { Grammar(): Grammar::base_type( start ) { using qi::lexeme; using qi::double_; using qi::bool_; using ascii::char_; start = value_rule.alias(); object_rule = '{' &gt;&gt; pair_rule % ',' &gt;&gt; '}'; pair_rule = string_rule &gt;&gt; ':' &gt;&gt; value_rule; value_rule = object_rule | array_rule | string_rule | nullptr_ | double_ | bool_; array_rule = '[' &gt;&gt; value_rule % ',' &gt;&gt; ']'; string_rule = lexeme[ '\"' &gt;&gt; *( char_ - '\"' ) &gt;&gt; '\"' ]; } qi::rule&lt;Iterator, boost::any(), ascii::space_type&gt; start; qi::rule&lt;Iterator, map_any(), ascii::space_type&gt; object_rule; qi::rule&lt;Iterator, pair_any(), ascii::space_type&gt; pair_rule; qi::rule&lt;Iterator, boost::any(), ascii::space_type&gt; value_rule; qi::rule&lt;Iterator, vector_any(), ascii::space_type&gt; array_rule; qi::rule&lt;Iterator, std::string(), ascii::space_type&gt; string_rule; }; } int main(int argc, char** argv) { //"{\"name\":10}" const std::string source(argv[1]); json::Grammar&lt; std::string::const_iterator &gt; g; boost::any v; json::map_any ma; json::vector_any va; json::pair_any pa; std::string::const_iterator bit = source.begin(); std::string::const_iterator eit = source.end(); bool r = boost::spirit::qi::phrase_parse( bit, eit, g, boost::spirit::ascii::space, v ); if( r ) { std::cout &lt;&lt; BOOST_LIB_VERSION &lt;&lt; std::endl; std::cout &lt;&lt; v.type().name() &lt;&lt; std::endl; std::cout &lt;&lt; typeid(ma).name() &lt;&lt; std::endl; std::cout &lt;&lt; typeid(va).name() &lt;&lt; std::endl; std::cout &lt;&lt; typeid(pa).name() &lt;&lt; std::endl; return 0; std::vector&lt; boost::any&gt; a = boost::any_cast&lt; std::vector&lt; boost::any&gt; &gt;( v ); for( std::vector&lt; boost::any&gt;::iterator it = a.begin(); it != a.end(); ++it ) { if(it-&gt;type() == typeid(char*)) { std::cout &lt;&lt; boost::any_cast&lt; char*&gt;( *it ) &lt;&lt; std::endl; } else if(it-&gt;type() == typeid(const char*)) { std::cout &lt;&lt; boost::any_cast&lt; const char*&gt;( *it ) &lt;&lt; std::endl; } else if(it-&gt;type() == typeid(std::string)) { std::cout &lt;&lt; boost::any_cast&lt; std::string&gt;( *it ) &lt;&lt; std::endl; } else if(it-&gt;type() == typeid(double)) { std::cout &lt;&lt; boost::any_cast&lt; double&gt;( *it ) &lt;&lt; std::endl; } else if(it-&gt;type() == typeid(bool)) { std::cout &lt;&lt; boost::any_cast&lt; bool&gt;( *it ) &lt;&lt; std::endl; } else { std::cout &lt;&lt; boost::any_cast&lt; void * &gt;( *it ) &lt;&lt; std::endl; } } } else { std::cout &lt;&lt; "not found" &lt;&lt; std::endl; } return 0; } Build - g++ -g3 rule.cpp -I./boost_1_41_0 2&gt;&amp;1 | tee report.log Run ./a.out '[1.0,2.0]' </pre> </description> <category>Ticket</category> </item> <item> <author>Nikita Kniazev <nok.raven@…></author> <pubDate>Fri, 08 Dec 2017 17:16:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13093#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13093#comment:2</guid> <description> <p> Well, for this kind of questions I suppose no one except you will spend the time. If you really want to find the commit that fixed the problem you should use <a class="ext-link" href="https://git-scm.com/docs/git-bisect"><span class="icon">​</span>git bisect</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 13 Dec 2017 22:58:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13093#comment:3 https://svn.boost.org/trac10/ticket/13093#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket