Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:52:46

0001 /*!
0002 @file
0003 Defines macros for commonly used type traits.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_DETAIL_INTRINSICS_HPP
0011 #define BOOST_HANA_DETAIL_INTRINSICS_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 
0015 
0016 // We use intrinsics if they are available because it speeds up the
0017 // compile-times.
0018 #if defined(BOOST_HANA_CONFIG_CLANG)
0019 #   if __has_extension(is_empty)
0020 #       define BOOST_HANA_TT_IS_EMPTY(T) __is_empty(T)
0021 #   endif
0022 
0023 #   if __has_extension(is_final)
0024 #       define BOOST_HANA_TT_IS_FINAL(T) __is_final(T)
0025 #   endif
0026 
0027 // TODO: Right now, this intrinsic is never used directly because of
0028 //       https://llvm.org/bugs/show_bug.cgi?id=24173
0029 #   if __has_extension(is_constructible) && false
0030 #       define BOOST_HANA_TT_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__)
0031 #   endif
0032 
0033 #   if __has_extension(is_assignable)
0034 #       define BOOST_HANA_TT_IS_ASSIGNABLE(T, U) __is_assignable(T, U)
0035 #   endif
0036 
0037 #   if __has_extension(is_convertible)
0038 #       define BOOST_HANA_TT_IS_CONVERTIBLE(T, U) __is_convertible(T, U)
0039 #   endif
0040 #endif
0041 
0042 #if !defined(BOOST_HANA_TT_IS_EMPTY)
0043 #   include <type_traits>
0044 #   define BOOST_HANA_TT_IS_EMPTY(T) ::std::is_empty<T>::value
0045 #endif
0046 
0047 #if !defined(BOOST_HANA_TT_IS_FINAL)
0048 #   include <type_traits>
0049 #   define BOOST_HANA_TT_IS_FINAL(T) ::std::is_final<T>::value
0050 #endif
0051 
0052 #if !defined(BOOST_HANA_TT_IS_CONSTRUCTIBLE)
0053 #   include <type_traits>
0054 #   define BOOST_HANA_TT_IS_CONSTRUCTIBLE(...) ::std::is_constructible<__VA_ARGS__>::value
0055 #endif
0056 
0057 #if !defined(BOOST_HANA_TT_IS_ASSIGNABLE)
0058 #   include <type_traits>
0059 #   define BOOST_HANA_TT_IS_ASSIGNABLE(T, U) ::std::is_assignable<T, U>::value
0060 #endif
0061 
0062 #if !defined(BOOST_HANA_TT_IS_CONVERTIBLE)
0063 #   include <type_traits>
0064 #   define BOOST_HANA_TT_IS_CONVERTIBLE(T, U) ::std::is_convertible<T, U>::value
0065 #endif
0066 
0067 #endif // !BOOST_HANA_DETAIL_INTRINSICS_HPP