Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-01-01 23:16:56


Paul Mensonides wrote:
> #include <boost/preprocessor/seq/fold_left.hpp>
> #include <boost/preprocessor/seq/subseq.hpp>
>
> #define NUMBERS \
> (0)(1)(2)(3)(4)(5)(6)(7)(8)(9) \
> (10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \
> /* ... */
>
> #define RANGE(first, length) \
> BOOST_PP_SEQ_SUBSEQ( NUMBERS, first, length ) \
> /**/
>
> BOOST_PP_SEQ_FOLD_LEFT(AUX_MAX_ARITY_OP, -1, RANGE(0, 5))

Hmm, it doesn't work on Metrowerks 8.3: the compiler chokes on preprocessing
with the following diagnostics:

    Error : ',' expected
    fold_left.cpp line 19 BOOST_PP_SEQ_FOLD_LEFT(AUX_MAX_ARITY_OP, -1,
RANGE(0, 5))

It seems like it doesn't like BOOST_PP_SEQ_SUBSEQ - the example from the
docs fails as well:

#include <boost/preprocessor/seq/subseq.hpp>

#define SEQ (0)(1)(2)(3)(4)(5)

BOOST_PP_SEQ_SUBSEQ(SEQ, 2, 3) // expands to (2)(3)(4)

    Error : ',' expected
    subseq.cpp line 5 BOOST_PP_SEQ_SUBSEQ(SEQ, 2, 3) // expands to
(2)(3)(4)

Is it a known failure? It would be nice to have some tests for the SEQ stuff
:).

Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk