is_scalar.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef BOOST_QVM_IS_SCALAR_HPP_INCLUDED
  2. #define BOOST_QVM_IS_SCALAR_HPP_INCLUDED
  3. // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. namespace boost { namespace qvm {
  7. template <class T>
  8. struct
  9. is_scalar
  10. {
  11. static bool const value=false;
  12. };
  13. template <class T>
  14. struct
  15. is_scalar<T const>:
  16. is_scalar<T>
  17. {
  18. };
  19. template <> struct is_scalar<signed char> { static bool const value=true; };
  20. template <> struct is_scalar<unsigned char> { static bool const value=true; };
  21. template <> struct is_scalar<signed short> { static bool const value=true; };
  22. template <> struct is_scalar<unsigned short> { static bool const value=true; };
  23. template <> struct is_scalar<signed int> { static bool const value=true; };
  24. template <> struct is_scalar<unsigned int> { static bool const value=true; };
  25. template <> struct is_scalar<signed long> { static bool const value=true; };
  26. template <> struct is_scalar<unsigned long> { static bool const value=true; };
  27. template <> struct is_scalar<signed long long> { static bool const value=true; };
  28. template <> struct is_scalar<unsigned long long> { static bool const value=true; };
  29. template <> struct is_scalar<float> { static bool const value=true; };
  30. template <> struct is_scalar<double> { static bool const value=true; };
  31. template <> struct is_scalar<long double> { static bool const value=true; };
  32. } }
  33. #endif