Boost logo

Boost Users :

From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2008-07-10 18:01:58


________________________________________
De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de vicente.botet [vicente.botet_at_[hidden]]
Enviado el: jueves, 10 de julio de 2008 23:59
Para: boost-users_at_[hidden]
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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net