181ad6265SDimitry Andric //===----------------------------------------------------------------------===// 281ad6265SDimitry Andric // 381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 681ad6265SDimitry Andric // 781ad6265SDimitry Andric //===----------------------------------------------------------------------===// 881ad6265SDimitry Andric 981ad6265SDimitry Andric #ifndef _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H 1081ad6265SDimitry Andric #define _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H 1181ad6265SDimitry Andric 1281ad6265SDimitry Andric #include <__config> 1381ad6265SDimitry Andric #include <__type_traits/integral_constant.h> 1481ad6265SDimitry Andric #include <__type_traits/is_fundamental.h> 1581ad6265SDimitry Andric 1681ad6265SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 1781ad6265SDimitry Andric # pragma GCC system_header 1881ad6265SDimitry Andric #endif 1981ad6265SDimitry Andric 2081ad6265SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD 2181ad6265SDimitry Andric 22753f127fSDimitry Andric #if __has_builtin(__is_compound) 2381ad6265SDimitry Andric 2481ad6265SDimitry Andric template <class _Tp> 2581ad6265SDimitry Andric struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> {}; 2681ad6265SDimitry Andric 27*06c3fb27SDimitry Andric # if _LIBCPP_STD_VER >= 17 2881ad6265SDimitry Andric template <class _Tp> 2981ad6265SDimitry Andric inline constexpr bool is_compound_v = __is_compound(_Tp); 3081ad6265SDimitry Andric # endif 3181ad6265SDimitry Andric 32753f127fSDimitry Andric #else // __has_builtin(__is_compound) 3381ad6265SDimitry Andric 34*06c3fb27SDimitry Andric template <class _Tp> 35*06c3fb27SDimitry Andric struct _LIBCPP_TEMPLATE_VIS is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> {}; 3681ad6265SDimitry Andric 37*06c3fb27SDimitry Andric # if _LIBCPP_STD_VER >= 17 3881ad6265SDimitry Andric template <class _Tp> 3981ad6265SDimitry Andric inline constexpr bool is_compound_v = is_compound<_Tp>::value; 4081ad6265SDimitry Andric # endif 4181ad6265SDimitry Andric 42753f127fSDimitry Andric #endif // __has_builtin(__is_compound) 4381ad6265SDimitry Andric 4481ad6265SDimitry Andric _LIBCPP_END_NAMESPACE_STD 4581ad6265SDimitry Andric 4681ad6265SDimitry Andric #endif // _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H 47