Subject: [Boost-bugs] [Boost C++ Libraries] #13372: Boost Preprocessing: compiler error: macro "BOOST_PP_VARIADIC_ELEM_2" requires 4 arguments, but only 2 given
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-01-01 19:30:49
#13372: Boost Preprocessing: compiler error: macro "BOOST_PP_VARIADIC_ELEM_2"
requires 4 arguments, but only 2 given
-----------------------------------+---------------------------
Reporter: Dmitrii B <d4qcdes@â¦> | Owner: No-Maintainer
Type: Bugs | Status: new
Milestone: To Be Determined | Component: preprocessor
Version: Boost 1.64.0 | Severity: Problem
Keywords: |
-----------------------------------+---------------------------
The following code produces the following compiler error when compiled
with gcc 7.2.0 or clang 3.8.0
{{{
error: macro "BOOST_PP_VARIADIC_ELEM_2" requires 4 arguments, but only 2
given
}}}
{{{
#include <boost/preprocessor.hpp>
#define CREATE_ENUM_ELEMENT(elementTuple)
\
BOOST_PP_IF(BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(elementTuple), 3),
\
BOOST_PP_TUPLE_ELEM(0, elementTuple) = BOOST_PP_TUPLE_ELEM(2,
elementTuple), \
BOOST_PP_TUPLE_ELEM(0, elementTuple)
\
),
enum class MyEnum {
CREATE_ENUM_ELEMENT((El1))
};
int main() {
return 0;
}
}}}
(online demo: http://coliru.stacked-crooked.com/a/f01351ee7a0ca55d )
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13372> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2018-01-01 19:36:19 UTC