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

BOOST_HAS_BUILTIN/BOOST_HAS_INCLUDE #477

Open
gpeterhoff opened this issue Jun 3, 2023 · 0 comments
Open

BOOST_HAS_BUILTIN/BOOST_HAS_INCLUDE #477

gpeterhoff opened this issue Jun 3, 2023 · 0 comments

Comments

@gpeterhoff
Copy link

BOOST_HAS_BUILTIN
e.g. clang/gcc support __has_builtin. However, you have to check if this is actually available before using it. I think it would be useful to introduce a macro BOOST_HAS_BUILTIN to avoid redundant queries:

#if defined(__has_builtin)
#define BOOST_HAS_BUILTIN(ARG) __has_builtin(ARG)
#else
#define BOOST_HAS_BUILTIN(ARG) 0
#endif

Maybe you can extend this for other compilers.

BOOST_HAS_INCLUDE
__has_include is only available from C++17 on. Maybe you have an idea how to implement/provide this for older versions, a la

#if defined(__has_include)
#define BOOST_HAS_INCLUDE(ARG) __has_include(ARG)
#else
???
#endif

thx
Gero

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