From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-05-21 07:54:58
[Replying to my own post.]
From: "Vesa Karvonen" <vesa.karvonen_at_[hidden]>
> Treating the first element as a special case is one way to solve the
> of creating lists. It has the advantage that the enumeration macro
> implementation is slightly simpler. On the other hand, the user then needs
> to implement both the general and the special case macros.
> However, INC and DEC don't solve the problem of having to use a special
> for the first or last element.
Actually, these statements of mine aren't quite that conclusive anymore,
because BOOST_IF(c,THEN,ELSE) makes it possible to avoid the special case
for the first element.
In particular, BOOST_IF now makes it possible to implement a conditional
This means that the user doesn't have to treat the first element as a
static const int
#define ELEMENT(i) BOOST_COND_COMMA_FUN(i) BOOST_INC(i)
#define BOOST_IF(c,T,E) BOOST_IF##c(T,E)
#define BOOST_IF0(T,E) E
#define BOOST_IF1(T,E) T
#define BOOST_IF2(T,E) T
#define BOOST_IF256(T,E) T
- Are IF, DEC and INC robust enough for production use?
- Is LIST() now redundant?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk