| 1 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000-2005. |
| 2 | // Use, modification and distribution are subject to the Boost Software License, |
| 3 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 4 | // http://www.boost.org/LICENSE_1_0.txt). |
| 5 | // |
| 6 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
| 7 | |
| 8 | #ifndef BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED |
| 9 | #define BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED |
| 10 | |
| 11 | #include <boost/type_traits/integral_constant.hpp> |
| 12 | |
| 13 | #ifndef BOOST_NO_CXX23_HDR_STDFLOAT |
| 14 | #include <stdfloat> |
| 15 | #endif |
| 16 | |
| 17 | namespace boost { |
| 18 | |
| 19 | //* is a type T a floating-point type described in the standard (3.9.1p8) |
| 20 | template <class T> struct is_floating_point : public false_type{}; |
| 21 | template <class T> struct is_floating_point<const T> : public is_floating_point<T>{}; |
| 22 | template <class T> struct is_floating_point<volatile const T> : public is_floating_point<T>{}; |
| 23 | template <class T> struct is_floating_point<volatile T> : public is_floating_point<T>{}; |
| 24 | template<> struct is_floating_point<float> : public true_type{}; |
| 25 | template<> struct is_floating_point<double> : public true_type{}; |
| 26 | template<> struct is_floating_point<long double> : public true_type{}; |
| 27 | |
| 28 | #if defined(BOOST_HAS_FLOAT128) |
| 29 | template<> struct is_floating_point<__float128> : public true_type{}; |
| 30 | #endif |
| 31 | |
| 32 | #ifndef BOOST_NO_CXX23_HDR_STDFLOAT |
| 33 | #if defined(__STDCPP_FLOAT16_T__) |
| 34 | template<> struct is_floating_point<std::float16_t> : public true_type {}; |
| 35 | #endif |
| 36 | #if defined(__STDCPP_FLOAT32_T__) |
| 37 | template<> struct is_floating_point<std::float32_t> : public true_type {}; |
| 38 | #endif |
| 39 | #if defined(__STDCPP_FLOAT64_T__) |
| 40 | template<> struct is_floating_point<std::float64_t> : public true_type {}; |
| 41 | #endif |
| 42 | #if defined(__STDCPP_FLOAT128_T__) |
| 43 | template<> struct is_floating_point<std::float128_t> : public true_type {}; |
| 44 | #endif |
| 45 | #if defined(__STDCPP_BFLOAT16_T__) |
| 46 | template<> struct is_floating_point<std::bfloat16_t> : public true_type {}; |
| 47 | #endif |
| 48 | #endif |
| 49 | |
| 50 | } // namespace boost |
| 51 | |
| 52 | #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED |
| 53 | |