quat_traits.hpp 823 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef BOOST_QVM_QUAT_TRAITS
  2. #define BOOST_QVM_QUAT_TRAITS
  3. /// Copyright (c) 2008-2021 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 Q>
  8. struct
  9. quat_traits
  10. {
  11. typedef void scalar_type;
  12. };
  13. namespace
  14. is_quaternion_detail
  15. {
  16. template <class>
  17. struct
  18. is_void
  19. {
  20. static bool const value=false;
  21. };
  22. template <>
  23. struct
  24. is_void<void>
  25. {
  26. static bool const value=true;
  27. };
  28. }
  29. template <class T>
  30. struct
  31. is_quat
  32. {
  33. static bool const value=!is_quaternion_detail::is_void<typename quat_traits<T>::scalar_type>::value;
  34. };
  35. } }
  36. #endif