Boost logo

Boost :

From: Peder Holt (peder.holt_at_[hidden])
Date: 2006-03-09 14:21:06


BOOST_PP_CAT involving __LINE__ fails for VC < 8.0

#include <boost/preprocessor/cat.hpp>

void test() {
    int i=1;
    int BOOST_PP_CAT(i,__LINE__)=1;
}

with the following error message:
d:\SourceCode\finally\test.cpp(5) : error C2374: 'i' : redefinition;
multiple initialization
        d:\SourceCode\finally\test.cpp(4) : see declaration of 'i'
d:\SourceCode\finally\test.cpp(5) : error C2143: syntax error :
missing ';' before '='
d:\SourceCode\finally\test.cpp(5) : error C2143: syntax error :
missing ';' before '='

Preprocessing the code using /P /EP first, yields valid code that
compiles without problems.

Regards,
Peder


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk