[preprocessor] BOOST_PP_CAT fails for VC6.5 and VC7.1

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

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Peder Holt Sent: Thursday, March 09, 2006 11:21 AM To: boost@lists.boost.org Subject: [boost] [preprocessor] BOOST_PP_CAT fails for VC6.5 and VC7.1
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.
No time right now, but it has to do with debug info. See the recent thread on the users' list "Boost.Preprocessor with __LINE__ in MSVC71". Regards, Paul Mensonides
participants (2)
-
Paul Mensonides
-
Peder Holt