Boost logo

Boost Users :

From: Sergey Sadovnikov (flex_ferrum_at_[hidden])
Date: 2008-05-08 05:00:56


Hello All,

Compilator: VC++ 8.0
Library version: 1.34

I can't understand problem with code like this:

#define SOME_SEQ (1)(2)(3)
#define BAR_MACRO_1(S) BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TAIL(S))
#define FOO_MACRO(S) BOOST_PP_CAT(BAR_MACRO_, BOOST_PP_SEQ_HEAD(S) ## (S))

FOO_MACRO(SOME_SEQ)

After preprocessing it looks like
BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, BOOST_PP_CAT(BOOST_PP_SEQ_SIZE_, BOOST_PP_SEQ_SIZE_2)) (2)(3)

If I replace BOOST_PP_CAT with my own macro:

#define MY_CAT(a, b) MY_CAT_I(a, b)
#define MY_CAT_I(a, b) a ## b

Everything is all right after preprocessing:
2, 3

Why? What is wrong?

-- 
Best Regards,
 Sergey                          mailto:flex_ferrum_at_[hidden]

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