Boost C++ Libraries: Ticket #8857: Compile error in boost range when trying to use boost string split https://svn.boost.org/trac10/ticket/8857 <p> I am trying to replace some old string split code with the string split algorithm, but am getting compile errors. OS <a class="missing wiki">CentOs</a> 6.3, Boost 1.53 and 1.54 gcc 4.8.1 without -std=c++ parameter. I have done an extensive search and tried multiple possible fixes and the error still occurs. </p> <p> Here is the error: </p> <p> In file included from /opt/boost_1_53/boost/range/concepts.hpp:21:0, </p> <blockquote> <p> from XXXX.C:37: </p> </blockquote> <p> /opt/boost_1_53/boost/range/begin.hpp: In instantiation of 'typename boost::range_iterator&lt;C&gt;::type boost::range_detail::range_begin(C&amp;) [with C = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]': /opt/boost_1_53/boost/range/begin.hpp:119:27: required from 'typename boost::range_iterator&lt;const T&gt;::type boost::range_adl_barrier::begin(const T&amp;) [with T = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/iterator_range_core.hpp:56:64: required from 'static IteratorT boost::iterator_range_detail::iterator_range_impl&lt;IteratorT&gt;::adl_begin(<a class="missing wiki">ForwardRange</a>&amp;) [with <a class="missing wiki">ForwardRange</a> = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; IteratorT = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/iterator_range_core.hpp:198:45: required from 'boost::iterator_range&lt;IteratorT&gt;::iterator_range(const Range&amp;, boost::iterator_range_detail::const_range_tag) [with Range = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; IteratorT = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/iterator_range_core.hpp:564:63: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;const T&gt;::type&gt; boost::make_iterator_range(const <a class="missing wiki">ForwardRange</a>&amp;) [with <a class="missing wiki">ForwardRange</a> = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/as_literal.hpp:93:50: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;C&gt;::type&gt; boost::range_detail::make_range(T&amp;, long int) [with T = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/as_literal.hpp:109:74: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;const T&gt;::type&gt; boost::as_literal(const Range&amp;) [with Range = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/algorithm/string/iter_find.hpp:153:115: required from 'SequenceSequenceT&amp; boost::algorithm::iter_split(SequenceSequenceT&amp;, RangeT&amp;, FinderT) [with SequenceSequenceT = std::vector&lt;std::basic_string&lt;char&gt; &gt;; RangeT = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; FinderT = boost::algorithm::detail::token_finderF&lt;boost::algorithm::detail::is_any_ofF&lt;char&gt; &gt;]' /opt/boost_1_53/boost/algorithm/string/split.hpp:149:69: required from 'SequenceSequenceT&amp; boost::algorithm::split(SequenceSequenceT&amp;, RangeT&amp;, PredicateT, boost::algorithm::token_compress_mode_type) [with SequenceSequenceT = std::vector&lt;std::basic_string&lt;char&gt; &gt;; RangeT = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; PredicateT = boost::algorithm::detail::is_any_ofF&lt;char&gt;]' XXXX.C:1287:60: required from here /opt/boost_1_53/boost/range/begin.hpp:49:24: error: 'const struct boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;' has no member named 'begin' </p> <blockquote> <p> return c.begin(); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> make<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">[2]</a>: Leaving directory `/for_blair/workspace/bluemax3/libcommon/src/common' In file included from /opt/boost_1_53/boost/range/concepts.hpp:22:0, </p> <blockquote> <p> from XXXX.C:37: </p> </blockquote> <p> /opt/boost_1_53/boost/range/end.hpp: In instantiation of 'typename boost::range_iterator&lt;C&gt;::type boost::range_detail::range_end(C&amp;) [with C = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]': /opt/boost_1_53/boost/range/end.hpp:113:25: required from 'typename boost::range_iterator&lt;const T&gt;::type boost::range_adl_barrier::end(const T&amp;) [with T = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/iterator_range_core.hpp:62:62: required from 'static IteratorT boost::iterator_range_detail::iterator_range_impl&lt;IteratorT&gt;::adl_end(<a class="missing wiki">ForwardRange</a>&amp;) [with <a class="missing wiki">ForwardRange</a> = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; IteratorT = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' make<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>: Leaving directory `/for_blair/workspace/bluemax3/libcommon/src' /opt/boost_1_53/boost/range/iterator_range_core.hpp:198:74: required from 'boost::iterator_range&lt;IteratorT&gt;::iterator_range(const Range&amp;, boost::iterator_range_detail::const_range_tag) [with Range = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; IteratorT = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/iterator_range_core.hpp:564:63: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;const T&gt;::type&gt; boost::make_iterator_range(const <a class="missing wiki">ForwardRange</a>&amp;) [with <a class="missing wiki">ForwardRange</a> = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/as_literal.hpp:93:50: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;C&gt;::type&gt; boost::range_detail::make_range(T&amp;, long int) [with T = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/range/as_literal.hpp:109:74: required from 'boost::iterator_range&lt;typename boost::range_iterator&lt;const T&gt;::type&gt; boost::as_literal(const Range&amp;) [with Range = boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;const T&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]' /opt/boost_1_53/boost/algorithm/string/iter_find.hpp:153:115: required from 'SequenceSequenceT&amp; boost::algorithm::iter_split(SequenceSequenceT&amp;, RangeT&amp;, FinderT) [with SequenceSequenceT = std::vector&lt;std::basic_string&lt;char&gt; &gt;; RangeT = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; FinderT = boost::algorithm::detail::token_finderF&lt;boost::algorithm::detail::is_any_ofF&lt;char&gt; &gt;]' /opt/boost_1_53/boost/algorithm/string/split.hpp:149:69: required from 'SequenceSequenceT&amp; boost::algorithm::split(SequenceSequenceT&amp;, RangeT&amp;, PredicateT, boost::algorithm::token_compress_mode_type) [with SequenceSequenceT = std::vector&lt;std::basic_string&lt;char&gt; &gt;; RangeT = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; PredicateT = boost::algorithm::detail::is_any_ofF&lt;char&gt;]' XXXX.C:1287:60: required from here /opt/boost_1_53/boost/range/end.hpp:50:26: error: 'const struct boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;' has no member named 'end' </p> <blockquote> <p> return c.end(); </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> In file included from /opt/boost_1_53/boost/range/concepts.hpp:21:0, </p> <blockquote> <p> from XXXX.C:37: </p> </blockquote> <p> /opt/boost_1_53/boost/range/begin.hpp: In function 'typename boost::range_iterator&lt;C&gt;::type boost::range_detail::range_begin(C&amp;) [with C = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]': /opt/boost_1_53/boost/range/begin.hpp:50:5: warning: control reaches end of non-void function [-Wreturn-type] </p> <blockquote> <p> } <sup> </sup></p> </blockquote> <p> In file included from /opt/boost_1_53/boost/range/concepts.hpp:22:0, </p> <blockquote> <p> from XXXX.C:37: </p> </blockquote> <p> /opt/boost_1_53/boost/range/end.hpp: In function 'typename boost::range_iterator&lt;C&gt;::type boost::range_detail::range_end(C&amp;) [with C = const boost::sub_match&lt;<span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; typename boost::range_iterator&lt;C&gt;::type = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;]': /opt/boost_1_53/boost/range/end.hpp:51:9: warning: control reaches end of non-void function [-Wreturn-type] </p> <blockquote> <p> } <sup> </sup></p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8857 Trac 1.4.3 Marshall Clow Tue, 23 Jul 2013 16:51:23 GMT <link>https://svn.boost.org/trac10/ticket/8857#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8857#comment:1</guid> <description> <p> I'm going to need to see some sample code demonstrating the problem. </p> <p> P.S. How is this different from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8858" title="#8858: Bugs: Compile error in boost range when trying to use boost string split (closed: duplicate)">#8858</a> ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 23 Jul 2013 17:01:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8857#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8857#comment:2</guid> <description> <p> As to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8858" title="#8858: Bugs: Compile error in boost range when trying to use boost string split (closed: duplicate)">#8858</a> it isn't different I accidentally hit something on the page and it resubmitted as an edit. </p> <p> As to some example code you can just use the standard boost::split example with gcc 4.8.1 as a compiler. It shows the error perfectly. </p> <p> Blair </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 23 Jul 2013 19:24:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8857#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8857#comment:3</guid> <description> <p> Strange. I get no such errors here (tried with clang 3.3, clang 3.4, gcc 4.2.1 and gcc 4.8.1) </p> <pre class="wiki">$ cd $BOOST/release/libs/algorithm/string/example $ /Volumes/Bay2/gcc/gcc-4.8.1/bin/bin/g++ split_example.cpp -I $BOOST/release $ $ /Volumes/Bay2/gcc/gcc-4.8.1/bin/bin/g++ --version g++ (GCC) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 12 Aug 2013 17:20:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8857#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8857#comment:4</guid> <description> <p> Strange ? ?? You used Clang 3.3 and gcc 4.2 ( how about msvc and xlc and cint and icc ) </p> <p> they all error compile with just this include #include &lt;boost/algorithm/string/split.hpp&gt; </p> <p> N:\boost_1_54_0\boost/utility/result_of.hpp(170) : error C2065: 'SB' : identificateur non déclaré and so on... for 500 errors </p> <p> template&lt;typename F&gt; struct is_function_with_no_args&lt;F(void)&gt; : mpl::true_ {}; &lt;-- error C2062: type 'void' unexpected, 'SB' undeclared , undefined 'Fargs' ... </p> </description> <category>Ticket</category> </item> </channel> </rss>