Boost C++ Libraries: Ticket #6374: operator << for exception doesn't work with 0/1 length tuples https://svn.boost.org/trac10/ticket/6374 <p> The operator&lt;&lt; for boost exception allows attaching error_info structures. As a convenience it also takes a tuple form of those info structures. This tuple form does not work if the tuple is empty (0-length) or also if it is 1-length. </p> <p> This is a compile-time matching issue. </p> <p> The attached code shows the compile error (reduced to the essentials). It also includes the workaround which I am currently using (compile with WORKAROUND defined). Ideally the non-workaround version should work. </p> <p> NOTE: This doesn't appear related to the macro itself. If you simple instantiate the exception and error_info tuple and use the operator directly the same compile-time error occurs. I've left the MACRO form to show the intent. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6374 Trac 1.4.3 edA-qa mort-ora-y <edA-qa@…> Tue, 10 Jan 2012 10:36:17 GMT attachment set https://svn.boost.org/trac10/ticket/6374 https://svn.boost.org/trac10/ticket/6374 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_exception_tuple.cc</span> </li> </ul> <p> repoduction and workaround </p> Ticket edA-qa mort-ora-y <edA-qa@…> Tue, 10 Jan 2012 10:37:47 GMT <link>https://svn.boost.org/trac10/ticket/6374#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6374#comment:1</guid> <description> <p> I'm using: gcc (GCC) 4.4.5 20101112 (Red Hat 4.4.5-2) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Wed, 11 Jan 2012 01:13:27 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6374#comment:2 https://svn.boost.org/trac10/ticket/6374#comment:2 <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> Fixed in trunk revision 76403, however I would suggest not using boost::tuple for this purpose, it might be better to instead unroll the ... in your macro into separate operator &lt;&lt; calls. </p> Ticket edA-qa mort-ora-y <edA-qa@…> Wed, 11 Jan 2012 05:51:29 GMT <link>https://svn.boost.org/trac10/ticket/6374#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6374#comment:3</guid> <description> <p> Why do you suggest that I don't use it for this purpose? Is it not efficient -- I'm expecting in optimized build the tuple stuff just disappears. </p> <p> I'd be happy to just unroll the ... but I'm not aware of any language feature that would let me unroll it. Is it possible with BOOST's preprocessor library? </p> </description> <category>Ticket</category> </item> </channel> </rss>