Boost C++ Libraries: Ticket #7560: [preprocessor] empty tuples are reported to have length equal to 1 https://svn.boost.org/trac10/ticket/7560 <p> BOOST_PP_TUPLE_SIZE(()) expands to 1 under gcc with c++0x support enabled </p> <p> gcc --version gcc (GCC) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7560 Trac 1.4.3 Bruno Dutra <brunocodutra@…> Wed, 24 Oct 2012 04:10:39 GMT <link>https://svn.boost.org/trac10/ticket/7560#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:1</guid> <description> <p> First of all I must thank the effor all the developers have clearly put into developing the Preprocessor library. It really is an amazing work. </p> <p> Back to the topic, now thinking about it, maybe () is indeed intended to be a 1-element tuple, following the fact, that an empty macro argument is still an argument since C99 and also C++11. That would ofcourse mean there is no such thing as an empty tuple as implemented by the Preprocessor library, but nonetheless, since there is no mention of such behavior on the documentation, one might be induced to understand, that an empty tuple is in fact well defined. Finaly, due to the fact this behaviour is dependent of one's subjective interpretation, as I see it this issue still configures a bug, at least a documentation one. </p> <p> Should however the reported behavior be confirmed as not intended, JENS GUSTEDT proposes a solution to the "problem of detecting empty variadic macro arguments" here: <a class="ext-link" href="http://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/"><span class="icon">​</span>http://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/</a>, which I would be glad to implement as a patch, once the intended behavior is well clarified. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 24 Oct 2012 04:12:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7560#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:2</guid> <description> <p> () is indeed considered a one element tuple. </p> </description> <category>Ticket</category> </item> <item> <author>Bruno Dutra <brunocodutra@…></author> <pubDate>Wed, 24 Oct 2012 04:19:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7560#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7560#comment:2" title="Comment 2">steven_watanabe</a>: </p> <blockquote class="citation"> <p> () is indeed considered a one element tuple. </p> </blockquote> <p> Thank you Steven, that does make a lot of sence. In this case I should perhaps look into sugesting modifications to make it more obvious on the documentation. </p> </description> <category>Ticket</category> </item> <item> <author>Bruno Dutra <brunocodutra@…></author> <pubDate>Wed, 24 Oct 2012 04:24:58 GMT</pubDate> <title>severity changed https://svn.boost.org/trac10/ticket/7560#comment:4 https://svn.boost.org/trac10/ticket/7560#comment:4 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> Downgrading the severity from showstopper to problem, since it turns out to be a documentation problem only. </p> Ticket Maxim Yanchenko Fri, 16 Aug 2013 09:45:42 GMT <link>https://svn.boost.org/trac10/ticket/7560#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:5</guid> <description> <p> It exists in documentation: "Valid tuple sizes range <strong>from 1</strong> to BOOST_PP_LIMIT_TUPLE." (<a href="http://www.boost.org/doc/libs/1_54_0/libs/preprocessor/doc/ref/tuple_elem.html">http://www.boost.org/doc/libs/1_54_0/libs/preprocessor/doc/ref/tuple_elem.html</a>) </p> <p> But would be good to have it on the main tuple page as well, not only on tuple_elem page. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Sun, 17 May 2015 04:51:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7560#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:6</guid> <description> <p> The documentation on the tuple data type has been updated in the 'develop' branch of the preprocessor library to explain that a tuple can never be empty and have a size of 0. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Fri, 21 Aug 2015 13:47:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7560#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7560#comment:7</guid> <description> <p> This has now been fixed in the latest Boost 1.59 release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Fri, 21 Aug 2015 13:47:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7560#comment:8 https://svn.boost.org/trac10/ticket/7560#comment:8 <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> Ticket