N
Noah Roberts
#define STR_HELPER(s) #s
#define STRINGIZE(s) STR_HELPER(s)
// BOOST_PP_CAT also fails for same reason.
#define MACRO(s1,s2) STRINGIZE(s1 ## s2)
#include <iostream>
int main()
{
std::cout << STRINGIZE(hello(int,int)) << std::endl; // fine.
std::cout << MACRO(hello, (int,int)) << std::endl; // error.
}
Error = concatination of 'hello' and '(' creates invalid preprocessor
token.
Both versions work fine in MSVC++. G++ hates it.
What's the deal? Who's wrong and why?
thx
#define STRINGIZE(s) STR_HELPER(s)
// BOOST_PP_CAT also fails for same reason.
#define MACRO(s1,s2) STRINGIZE(s1 ## s2)
#include <iostream>
int main()
{
std::cout << STRINGIZE(hello(int,int)) << std::endl; // fine.
std::cout << MACRO(hello, (int,int)) << std::endl; // error.
}
Error = concatination of 'hello' and '(' creates invalid preprocessor
token.
Both versions work fine in MSVC++. G++ hates it.
What's the deal? Who's wrong and why?
thx