| 1 | #ifndef BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED |
|---|---|
| 2 | #define BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED |
| 3 | |
| 4 | // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. |
| 5 | |
| 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 7 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 8 | |
| 9 | #include <boost/qvm/config.hpp> |
| 10 | #include <boost/qvm/assert.hpp> |
| 11 | |
| 12 | namespace boost { namespace qvm { |
| 13 | |
| 14 | template <class> |
| 15 | struct quat_traits; |
| 16 | |
| 17 | template <class QuatType,class ScalarType> |
| 18 | struct |
| 19 | quat_traits_defaults |
| 20 | { |
| 21 | typedef QuatType quat_type; |
| 22 | typedef ScalarType scalar_type; |
| 23 | |
| 24 | template <int I> |
| 25 | static |
| 26 | BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL |
| 27 | scalar_type |
| 28 | read_element( quat_type const & x ) |
| 29 | { |
| 30 | return quat_traits<quat_type>::template write_element<I>(const_cast<quat_type &>(x)); |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | } } |
| 35 | |
| 36 | #endif |
| 37 |
