Re: [Boost-users] [preporcessor]Can we use BOOST_PP_SEQ_FOLD_LEFT on sequences with one element?
________________________________________ De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de vicente.botet [vicente.botet@wanadoo.fr] Enviado el: jueves, 10 de julio de 2008 23:59 Para: boost-users@lists.boost.org Asunto: [Boost-users] [preporcessor]Can we use BOOST_PP_SEQ_FOLD_LEFT onsequences with one element?
Hello,
I'm a beginer with the preprocessor library. My goal is to generate from a sequence (a)(b)(c) => a::b::c and from (a) => a
[...]
BOOST_PP_SEQ_FOLD_LEFT(NAME, BOOST_PP_SEQ_HEAD((a)), BOOST_PP_SEQ_TAIL((a)))
Here lies the problem: (a) does not have a tail (there is no such thing as an empty PP sequence, unfortunately). I'm afraid you'll have to treat sequences of size 1 separately from the general case. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
----- Original Message ----- From: "JOAQUIN M. LOPEZ MUÑOZ" joaquin@tid.es ________________________________________ De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de vicente.botet [vicente.botet@wanadoo.fr] Asunto: [Boost-users] [preporcessor]Can we use BOOST_PP_SEQ_FOLD_LEFT onsequences with one element?
I'm a beginer with the preprocessor library. My goal is to generate from a sequence (a)(b)(c) => a::b::c and from (a) => a
[...]
BOOST_PP_SEQ_FOLD_LEFT(NAME, BOOST_PP_SEQ_HEAD((a)), BOOST_PP_SEQ_TAIL((a)))
Here lies the problem: (a) does not have a tail (there is no such thing as
an empty PP sequence, unfortunately). I'm afraid you'll have to treat
sequences
of size 1 separately from the general case.
--
Thanks Joaquin,
the question now is how to treat sequences of size 1 separately from the
general case.
I have tried with BOOST_PP_IF, but it is no better.
#include
participants (2)
-
JOAQUIN M. LOPEZ MUÑOZ
-
vicente.botet