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

Minor feature request: BOOST_PP_IGNORE or update docs for BOOST_PP_EMPTY #45

Open
hadrielk opened this issue May 25, 2022 · 2 comments
Open

Comments

@hadrielk
Copy link

The current BOOST_PP_EMPTY() is not variadic, so its usefulness in BOOST_PP_IF() and the like is limited to when there are no arguments/params in the resultant call.

For example, this doesn't work:

#define X(a, b) result(a, b)
#define MACRO(a, b, c) BOOST_PP_IF(c, X, BOOST_PP_EMPTY)(a, b)

As explained in #34, changing the signature of BOOST_PP_EMPTY() is impractical, and another solution exists: BOOST_VMD_EMPTY(...) in boost/vmd/empty.hpp.

So this is a very minor issue, but it would be nice if either:

  1. There were a BOOST_PP_IGNORE(...) to do this, or...
  2. The reference docs for the BOOST_PP_EMPTY could also point to the VMD macro to use instead.
@andry81
Copy link

andry81 commented May 25, 2022

Why not just use this: https://www.boost.org/doc/libs/1_77_0/libs/preprocessor/doc/ref/identity_n.html

#define MACRO(a, b, c) BOOST_PP_IF(c, X, BOOST_PP_IDENTITY_N(BOOST_PP_EMPTY(),2))(a, b)

@hadrielk
Copy link
Author

Oh, it's not that I can't solve it myself - I did - it's just a minor request to either document the VMD one or add one to PP.

Not a big deal; just would be nice.

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

2 participants