Boost C++ Libraries: Ticket #11697: Boost.Container: Wrong initialization order in tuple copy-constructor https://svn.boost.org/trac10/ticket/11697 <p> Hello, </p> <p> In the file </p> <blockquote> <p> boost/container/detail/variadic_templates_tools.hpp </p> </blockquote> <p> in line 57 there is a bug because the inherited class comes in the initialization list after the member. The code should read </p> <blockquote> <p> <em> Construct tuple from another tuple. template&lt;typename... VValues&gt; tuple(const tuple&lt;VValues...&gt;&amp; other) </em></p> <blockquote> <p> <em> : m_head(other.head()), inherited(other.tail()) : inherited(other.tail()), m_head(other.head()) </em></p> </blockquote> <p> {} </p> </blockquote> <p> Best regards, Manuel </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11697 Trac 1.4.3 Manuel Freiberger <manuel.freiberger@…> Wed, 30 Sep 2015 14:44:29 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11697#comment:1 https://svn.boost.org/trac10/ticket/11697#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ion Gaztañaga</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">container</span> </li> </ul> Ticket Manuel Freiberger <manuel.freiberger@…> Wed, 30 Sep 2015 15:05:10 GMT <link>https://svn.boost.org/trac10/ticket/11697#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11697#comment:2</guid> <description> <p> Second try (now with the code embedded in a code block): </p> <pre class="wiki"> // Construct tuple from another tuple. template&lt;typename... VValues&gt; tuple(const tuple&lt;VValues...&gt;&amp; other) // : m_head(other.head()), inherited(other.tail()) : inherited(other.tail()), m_head(other.head()) {} </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 30 Sep 2015 20:40:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11697#comment:3 https://svn.boost.org/trac10/ticket/11697#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> <p> Thanks for the report. Inherited will always be constructed first, as the initialization order is fixed by the language despite the initialization list. In any case, it's misleading and it should be corrected. Fixed in commit: </p> <p> <a class="ext-link" href="https://github.com/boostorg/container/commit/79274e4aae91c563be1e49046bdf98b589d35294"><span class="icon">​</span>https://github.com/boostorg/container/commit/79274e4aae91c563be1e49046bdf98b589d35294</a> </p> Ticket Manuel Freiberger <manuel.freiberger@…> Thu, 01 Oct 2015 12:46:30 GMT <link>https://svn.boost.org/trac10/ticket/11697#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11697#comment:4</guid> <description> <p> The code was not wrong, I should have been clearer in my wording. The "problem" is that our compiler (ARMCC) reports a warning in this case. Thanks for silencing it! :-) </p> </description> <category>Ticket</category> </item> </channel> </rss>