is_floating_point.hpp 1.3 KB

123456789101112131415161718192021222324252627282930
  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. #ifndef BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED
  8. #define BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED
  9. #include <boost/type_traits/integral_constant.hpp>
  10. namespace boost {
  11. //* is a type T a floating-point type described in the standard (3.9.1p8)
  12. template <class T> struct is_floating_point : public false_type{};
  13. template <class T> struct is_floating_point<const T> : public is_floating_point<T>{};
  14. template <class T> struct is_floating_point<volatile const T> : public is_floating_point<T>{};
  15. template <class T> struct is_floating_point<volatile T> : public is_floating_point<T>{};
  16. template<> struct is_floating_point<float> : public true_type{};
  17. template<> struct is_floating_point<double> : public true_type{};
  18. template<> struct is_floating_point<long double> : public true_type{};
  19. #if defined(BOOST_HAS_FLOAT128)
  20. template<> struct is_floating_point<__float128> : public true_type{};
  21. #endif
  22. } // namespace boost
  23. #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED