Hi all,
I tried to compile a sample from the Boost.Preprocessor library which is:
#include <boost/preprocessor/seq/insert.hpp>
#define SEQ (a)(b)(d)
BOOST_PP_SEQ_INSERT(SEQ, 2, c) // expands to (a)(b)(c)(d)
on Visual Studio 2008 and I get the error error C2065: 'b' : undeclared identifier
Is there a problem with the sample or am I missing something??
Thanks,
Philipp
EDIT
Please note: The sequence definition itself is ok. To show this, I compiled this code:
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#define SEQ (w)(x)
#define MACRO(r, data, elem) BOOST_PP_CAT(elem, data)
struct w_
{
int x;
};
void test()
{
BOOST_PP_SEQ_FOR_EACH(MACRO, _, SEQ);
x_.x = 3;
}
DISCLAIMER: this code is WTF code, and I never intended to use BOOST PP like this :-)