Skip to content

BOOST_HAS_BUILTIN/BOOST_HAS_INCLUDE #477

@gpeterhoff

Description

@gpeterhoff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions