1、实现分析
integral_constant 获取 __is_constructible 返回结果
/// is_constructible
template<typename _Tp, typename... _Args>
struct is_constructible
: public __bool_constant<__is_constructible(_Tp, _Args...)>
{ };
template<bool __v>
using __bool_constant = integral_constant<bool, __v>;
#if __cplusplus > 201402L
# define __cpp_lib_bool_constant 201505
template<bool __v>
using bool_constant = integral_constant<bool, __v>;
#endif
2、__is_constructible 简单分析
__is_constructible 初步判断__is_constructible 是有编译器实现判断
#define DEFTRAIT_EXPR(CODE, NAME, ARITY) DEFTRAIT(tcc_expression, CODE, NAME, ARITY)
DEFTRAIT_EXPR (IS_CONSTRUCTIBLE, "__is_constructible", -1)
2022-09-30 Patrick Palka <ppalka@redhat.com>
* c-common.cc (c_common_reswords): Use cp/cp-trait.def to handle
C++ traits.