We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! I see your code. And I'm very confused why you should write like following.
rapidjson.h #define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y) #define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y) #define RAPIDJSON_DO_JOIN2(X, Y) X##Y
Could you tell me why? Thanks!
The text was updated successfully, but these errors were encountered:
The first indirection is needed in order to expand eventual macros in X or Y:
X
Y
#define FOO foo #define BAR bar // without indirection - concatenates unexpanded arguments RAPIDJSON_DO_JOIN2(FOO, BAR) // --> FOOBAR // with indirection - concatenates expanded arguments RAPIDJSON_JOIN(FOO,BAR) // --> foobar
The second indirection is probably no longer needed on today's preprocessors.
Sorry, something went wrong.
No branches or pull requests
Hello!
I see your code. And I'm very confused why you should write like following.
rapidjson.h
#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)
#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)
#define RAPIDJSON_DO_JOIN2(X, Y) X##Y
Could you tell me why?
Thanks!
The text was updated successfully, but these errors were encountered: