__has_include是一个C++17标准定义的宏,它的用途是检查指定的文件是否存在,从而决定是否继续编译。它可以在头文件包含中使用,这样编译器就可以根据它的返回值来决定是否继续编译,从而提升编译的效率。
用法示例:
#if defined __has_include
# if __has_include (<stdatomic.h>)
# include <stdatomic.h>
# endif
#endif
__has_include是一个C++17标准定义的宏,它的用途是检查指定的文件是否存在,从而决定是否继续编译。它可以在头文件包含中使用,这样编译器就可以根据它的返回值来决定是否继续编译,从而提升编译的效率。
用法示例:
#if defined __has_include
# if __has_include (<stdatomic.h>)
# include <stdatomic.h>
# endif
#endif