Boost C++ Libraries: Ticket #12431: BOOST_PP_TUPLE_PUSH_FRONT fails to expand with BOOST_PP_EXPAND https://svn.boost.org/trac10/ticket/12431 <p> This problem probably affects other preprocessor macros added in the 1.56.0 release, but this is one I bumped into. It is unfortunate that more bugs are appearing in the preprocessor code, since the original source code has been very useful and stable in the past, when it was first added. To compile the attached test2.cpp, use: </p> <pre class="wiki">g++ -Wall -Wextra -Werror -g -O0 -save-temps -o test2.o -c -fpic test2.cpp </pre><p> My testing has been using version 1.58, though this problem should have existed since 1.56. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12431 Trac 1.4.3 mjtruog@… Thu, 01 Sep 2016 23:49:44 GMT attachment set https://svn.boost.org/trac10/ticket/12431 https://svn.boost.org/trac10/ticket/12431 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test2.cpp</span> </li> </ul> <p> test2.cpp </p> Ticket mjtruog@… Tue, 20 Sep 2016 20:37:48 GMT <link>https://svn.boost.org/trac10/ticket/12431#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12431#comment:1</guid> <description> <p> The diff below solves the problem, by bringing the code for the arity 0 case back to the state it was in at version 1.48 (when compared to 1.58): </p> <pre class="wiki">--- /usr/include/boost/preprocessor/tuple/to_seq.hpp 2016-09-20 13:34:52.926120462 -0700 +++ /usr/include/boost/preprocessor/tuple/to_seq.hpp 2016-09-20 13:35:02.516377864 -0700 @@ -49,7 +49,7 @@ # endif # /* An empty array can be passed */ -# define BOOST_PP_TUPLE_TO_SEQ_0() () +# define BOOST_PP_TUPLE_TO_SEQ_0() # # define BOOST_PP_TUPLE_TO_SEQ_1(e0) (e0) # define BOOST_PP_TUPLE_TO_SEQ_2(e0, e1) (e0)(e1) </pre> </description> <category>Ticket</category> </item> <item> <author>mjtruog@…</author> <pubDate>Tue, 20 Sep 2016 21:23:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12431#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12431#comment:2</guid> <description> <p> To avoid this bug in BOOST_PP_TUPLE_TO_SEQ I used the work-around below: </p> <pre class="wiki">#include &lt;boost/preprocessor/list/for_each.hpp&gt; #include &lt;boost/preprocessor/tuple/to_list.hpp&gt; #define TUPLE_TO_SEQ_E(r, data, elem) (elem) #define TUPLE_TO_SEQ(I, T) \ BOOST_PP_LIST_FOR_EACH(TUPLE_TO_SEQ_E, _, BOOST_PP_TUPLE_TO_LIST(I, T)) </pre> </description> <category>Ticket</category> </item> <item> <author>mjtruog@…</author> <pubDate>Tue, 20 Sep 2016 21:36:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12431#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12431#comment:3</guid> <description> <p> I mistakenly posted these comments to the wrong bug, they were meant to be at <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/12426"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/12426</a>. I will put their contents there. </p> </description> <category>Ticket</category> </item> </channel> </rss>