Boost C++ Libraries: Ticket #13368: consuming_buffers.hpp: parse error in template argument list https://svn.boost.org/trac10/ticket/13368 <pre class="wiki">.../boost/boost/boost/asio/detail/consuming_buffers.hpp: In member function ‘boost::asio::detail::consuming_buffers&lt;Buffer, Buffers, Buffer_Iterator&gt;::prepared_buffers_type boost::asio::detail::consuming_buffers&lt;Buffer, Buffers, Buffer_Iterator&gt;::prepare(std::size_t)’: .../boost/boost/boost/asio/detail/consuming_buffers.hpp:105:50: erreur: parse error in template argument list while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; result.count &lt; result.max_buffers) ^ </pre><p> Context: Upgrade from 1_65_1 to 1_66 </p> <ul><li>Ubuntu 16.04 LTS / g++ v 5.4.0 </li><li>CentOS 7 / g++ v 4.8.5 </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13368 Trac 1.4.3 sami.elhini@… Tue, 02 Jan 2018 04:51:51 GMT <link>https://svn.boost.org/trac10/ticket/13368#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:1</guid> <description> <p> I am also seeing this error with 1_54_0. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 02 Jan 2018 12:21:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:2</guid> <description> <p> I think I know the issue. You have to make sure that if you update the libs you also update the headers. I compiled 1_66 and installed it using b2. I needed 1_54. I deleted the libs under /usr/local/lib (default install location, you may have chosen a different location) but not the headers under /usr/local/include/boost. </p> <p> When I deleted both libs and headers and reinstalled this error went away. </p> </description> <category>Ticket</category> </item> <item> <author>Anton Kryukov <akryukov@…></author> <pubDate>Thu, 04 Jan 2018 19:45:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:3</guid> <description> <p> I am having the same problem using gcc 4.8.4 on 14.04.1-Ubuntu. I installed boost 1.66 in a separate directory next to the previously installed boost 1.57 and pointed to it using environment variables. I recreated our build tree using CMake in a pristine directory and got this error: </p> <hr /> <p> In file included from .../boost_1_66_0/boost/asio/impl/write.hpp:25:0, </p> <blockquote> <p> from .../boost_1_66_0/boost/asio/write.hpp:927, </p> </blockquote> <blockquote> <p> from .../boost_1_66_0/boost/asio/buffered_write_stream.hpp:29, </p> </blockquote> <blockquote> <p> from .../boost_1_66_0/boost/asio/buffered_stream.hpp:22, </p> </blockquote> <blockquote> <p> from .../boost_1_66_0/boost/asio.hpp:41, </p> </blockquote> <blockquote> <p> from .../.../stdafx.h:39, </p> </blockquote> <blockquote> <p> from .../.../xxx.cpp:1: </p> </blockquote> <p> .../boost_1_66_0/boost/asio/detail/consuming_buffers.hpp: In member function ‘boost::asio::detail::consuming_buffers&lt;Buffer, Buffers, Buffer_Iterator&gt;::prepared_buffers_type boost::asio::detail::consuming_buffers&lt;Buffer, Buffers, Buffer_Iterator&gt;::prepare(std::size_t)’: </p> <p> .../boost_1_66_0/boost/asio/detail/consuming_buffers.hpp:105:50: error: parse error in template argument list </p> <blockquote> <p> while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; result.count &lt; result.max_buffers) </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <hr /> <p> In the stdafx.h file asio.hpp was #included after a bunch of other boost headers (and nothing else): </p> <blockquote> <p> #include &lt;boost/noncopyable.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/function.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/format.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/shared_ptr.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/scoped_ptr.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/foreach.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/bind.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/serialization/strong_typedef.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/range/algorithm.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/algorithm/string/predicate.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/lexical_cast.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/intrusive_ptr.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/variant.hpp&gt; </p> </blockquote> <blockquote> <p> #include &lt;boost/asio.hpp&gt; </p> </blockquote> <p> When I moved #include &lt;boost/asio.hpp&gt; to the front, the problem went away. Visual C++ 14.1 did not have this problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>awulkiew</dc:creator> <pubDate>Thu, 11 Jan 2018 01:46:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:4</guid> <description> <p> FYI, it seems that the code is somehow interfering with <code>boost::count</code>. To reproduce it you only need: </p> <pre class="wiki">#include &lt;boost/range/algorithm/count.hpp&gt; #include &lt;boost/asio/detail/consuming_buffers.hpp&gt; int main() {} </pre><p> It also affects Boost.Geometry (<a class="closed ticket" href="https://svn.boost.org/trac10/ticket/13386" title="#13386: Bugs: buffered_piece_collection.hpp: parse error in template argument list (closed: fixed)">#13386</a>). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 14 Jan 2018 17:09:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:5</guid> <description> <p> I followed this link and updated g++ from 5 to 6 and it solved the problem on ubuntu: </p> <p> <a class="ext-link" href="https://github.com/domoticz/domoticz/issues/2034"><span class="icon">​</span>https://github.com/domoticz/domoticz/issues/2034</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 08 Feb 2018 15:43:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:6</guid> <description> <p> Patch proposed in the same github discussion worked for me (gcc 5.4.0). </p> <pre class="wiki">--- a/boost/asio/detail/consuming_buffers.hpp +++ b/boost/asio/detail/consuming_buffers.hpp @@ -102,7 +102,7 @@ public: std::advance(next, next_elem_); std::size_t elem_offset = next_elem_offset_; - while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; result.count &lt; result.max_buffers) + while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; (result.count) &lt; result.max_buffers) { Buffer next_buf = Buffer(*next) + elem_offset; result.elems[result.count] = boost::asio::buffer(next_buf, max_size); </pre> </description> <category>Ticket</category> </item> <item> <author>chaitanya.pinninti@…</author> <pubDate>Tue, 08 May 2018 10:08:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13368#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13368#comment:7</guid> <description> <p> This worked for me. </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/13368#comment:6" title="Comment 6">anonymous</a>: </p> <blockquote class="citation"> <p> Patch proposed in the same github discussion worked for me (gcc 5.4.0). </p> <pre class="wiki">--- a/boost/asio/detail/consuming_buffers.hpp +++ b/boost/asio/detail/consuming_buffers.hpp @@ -102,7 +102,7 @@ public: std::advance(next, next_elem_); std::size_t elem_offset = next_elem_offset_; - while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; result.count &lt; result.max_buffers) + while (next != end &amp;&amp; max_size &gt; 0 &amp;&amp; (result.count) &lt; result.max_buffers) { Buffer next_buf = Buffer(*next) + elem_offset; result.elems[result.count] = boost::asio::buffer(next_buf, max_size); </pre></blockquote> </description> <category>Ticket</category> </item> </channel> </rss>