Why my token-pasting usage doesn't work?
I made the declaration as below.
define FUNC_DEC(f) inline void f##(){}
class MyClass { public: FUNC_DEC(a); FUNC_DEC(b); };
After preprocessing, I expected the class looked like class MyClass {
public: inline void a(){}; inline void b(){}; };
While actually, I got compiling errors
20 identifier "a" is undefined
20 identifier "b" is undefined
warnings Description Resource Path Location Type
891-D omission of explicit type is nonstandard ("int" assumed)
Can anybody tell me what's wrong with my declaration? Thank you so much.
No comments:
Post a Comment