Boost logo

Boost Users :

From: Mitch (bessermt_at_[hidden])
Date: 2003-11-16 02:00:09


I'm trying to figure out the longest sequence in a sequence. Here's the
MACRO I tried.

#define OP(size, state, elem) BOOST_PP_MAX(state, BOOST_PP_SEQ_SIZE(elem))

#define MACRO(seq) BOOST_PP_SEQ_FOLD_LEFT(OP, 0, seq)

If I process ((a)(b))((c)) I get 2 back as expected. However, the extra
parenthesis seems awkward. I'd like to process ((a)(b))(c) instead, but
can't. The '(c)' gets coverted to plain 'c' as the elem parameter to OP and
that's not a valid sequence. Any ideas?

Mitch


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