Skip to content
New issue

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

Issue for BOOST_PP_REMOVE_PARENS macro #50

Open
akeyliu opened this issue Jan 17, 2023 · 1 comment
Open

Issue for BOOST_PP_REMOVE_PARENS macro #50

akeyliu opened this issue Jan 17, 2023 · 1 comment

Comments

@akeyliu
Copy link

akeyliu commented Jan 17, 2023

I'm now using BOOST preprocess library for generate set/get/to_json/from_json code automatically. But I find some problem when using BOOST_PP_REMOVE_PARENS macro. Please check it.
Follow is the code in remove_parens.hpp with line 24-36.
The code for line 31 which should be (param) not (param)() in the original code.

#define BOOST_PP_REMOVE_PARENS(param)
BOOST_PP_IIF
(
BOOST_PP_IS_BEGIN_PARENS(param),
BOOST_PP_REMOVE_PARENS_DO,
BOOST_PP_IDENTITY
)
(param)() \ /// The content should be (param) not (param)().
/**/

#define BOOST_PP_REMOVE_PARENS_DO(param)
BOOST_PP_IDENTITY(BOOST_PP_TUPLE_ENUM(param))
/**/

@akeyliu
Copy link
Author

akeyliu commented Apr 10, 2023

I found the bug is that:

In the file: include\boost\preprocessor\punctuation\remove_parens.hpp
Line 34-35:
#define BOOST_PP_REMOVE_PARENS_DO(param)
BOOST_PP_IDENTITY(BOOST_PP_TUPLE_ENUM(param)) \

This will fail if the param is not TUPLE but SEQ or LIST.

I found the error when I am using SEQ and correct after I change to TUPLE.

Hope this can help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant