Boost C++ Libraries: Ticket #8418: Boost Fusion foreach works for std::tuple OR boost::tuple depending on inclusion order https://svn.boost.org/trac10/ticket/8418 <p> As my attached repro sample shows can't adapt std::tuple and boost::tuple at the same time. </p> <p> The headers </p> <pre class="wiki"># include &lt;boost/fusion/adapted/boost_tuple.hpp&gt; # include &lt;boost/fusion/adapted/std_tuple.hpp&gt; </pre><p> seem to mutually exclude each other (at least in this code sample). Which ever header of the two gets included _first_, determines which type of tuple will be usable as a fusion sequence in that TU. </p> <p> In the case of the 'blanket' include <code>boost/fusion/adapted.hpp</code> this means that std::tuple is not usable as a Fusion Sequence - unless one explicitely include <code>boost/fusion/adapted/std_tuple.hpp</code> _ahead_ of that. </p> <p> This is rather surprising, and obviously causes problems for people mixing std::tuple and boost::tuple within a sinlge TU. </p> <p> Also, although I haven't looked too deeply into the mechanics of it, I worry a bit that this may be a signal that <strong>ODR violations</strong> could be lurking when different TUs include the headers in different order. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8418 Trac 1.4.3 bugs@… Mon, 08 Apr 2013 12:18:23 GMT attachment set https://svn.boost.org/trac10/ticket/8418 https://svn.boost.org/trac10/ticket/8418 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> <p> Simple reproducer for ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8418" title="#8418: Bugs: Boost Fusion foreach works for std::tuple OR boost::tuple depending on ... (closed: fixed)">#8418</a> </p> Ticket anonymous Mon, 08 Apr 2013 12:46:09 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8418#comment:1 https://svn.boost.org/trac10/ticket/8418#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Joel de Guzman</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fusion</span> </li> </ul> Ticket anonymous Sat, 20 Apr 2013 14:42:19 GMT <link>https://svn.boost.org/trac10/ticket/8418#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8418#comment:2</guid> <description> <p> Hi, </p> <p> I believe the issue behind this is that the header guards for the following 2 files have the <strong>SAME</strong> header guard value of <strong><code>BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726</code></strong>. </p> <ol><li>boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp </li><li>boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp </li></ol> </description> <category>Ticket</category> </item> <item> <author>william@…</author> <pubDate>Sat, 20 Apr 2013 14:43:53 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8418 https://svn.boost.org/trac10/ticket/8418 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fusion.patch</span> </li> </ul> <p> Patch </p> Ticket William Lynch <william@…> Sat, 20 Apr 2013 14:52:22 GMT cc changed https://svn.boost.org/trac10/ticket/8418#comment:3 https://svn.boost.org/trac10/ticket/8418#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">william@…</span> added </li> </ul> Ticket anonymous Sun, 21 Apr 2013 12:03:26 GMT <link>https://svn.boost.org/trac10/ticket/8418#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8418#comment:4</guid> <description> <p> Amazing! I had this hunch, but on looking at the header guards, I concluded they looked like they are automatically generated :| </p> <p> On that ground I dismissed the possibility of a collision... How did you 'make up' a new 'unique' header guard name? </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Sun, 21 Apr 2013 13:55:02 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8418#comment:5 https://svn.boost.org/trac10/ticket/8418#comment:5 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84000" title="Fixes #8418">[84000]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8418" title="#8418: Bugs: Boost Fusion foreach works for std::tuple OR boost::tuple depending on ... (closed: fixed)">#8418</a> </p> Ticket William Lynch <william@…> Sun, 21 Apr 2013 16:13:53 GMT <link>https://svn.boost.org/trac10/ticket/8418#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8418#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8418#comment:4" title="Comment 4">anonymous</a>: </p> <blockquote class="citation"> <p> Amazing! I had this hunch, but on looking at the header guards, I concluded they looked like they are automatically generated :| </p> <p> On that ground I dismissed the possibility of a collision... How did you 'make up' a new 'unique' header guard name? </p> <p> Thanks! </p> </blockquote> <p> The tail end of the header guard appears to be a datetime string, so I changed that to today's date. I imagined that if I was wrong with that assumption, that Joel would have used a different one. </p> </description> <category>Ticket</category> </item> </channel> </rss>