----- Original Message -----
From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]>

> > #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))
> >
>
> Looks good! How efficient is it? For instance, if NUMBERS is a sequence
from
> 0 to 255?

It should be very efficient.  The length of the input doesn't matter, the
length of the output range matters slightly.  Actually, if you only need a
range starting from zero, you can use BOOST_PP_SEQ_FIRST_N instead of
BOOST_PP_SEQ_SUBSEQ which will be more efficient yet.

Paul Mensonides

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to