Boost C++ Libraries: Ticket #8858: Compile error in boost range when trying to use boost string split https://svn.boost.org/trac10/ticket/8858 <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> 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/8858 Trac 1.4.3 Marshall Clow Tue, 23 Jul 2013 17:12:53 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8858#comment:1 https://svn.boost.org/trac10/ticket/8858#comment:1 <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">duplicate</span> </li> </ul> <p> Duplicate of <a class="new ticket" href="https://svn.boost.org/trac10/ticket/8857" title="#8857: Bugs: Compile error in boost range when trying to use boost string split (new)">#8857</a> </p> Ticket