quat_assign.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED
  2. #define BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED
  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. #include <boost/qvm/inline.hpp>
  7. #include <boost/qvm/enable_if.hpp>
  8. #include <boost/qvm/quat_traits.hpp>
  9. namespace boost { namespace qvm {
  10. template <class A,class B>
  11. BOOST_QVM_INLINE_OPERATIONS
  12. typename enable_if_c<
  13. is_quat<A>::value && is_quat<B>::value,
  14. A &>::type
  15. assign( A & a, B const & b )
  16. {
  17. quat_traits<A>::template write_element<0>(a) = quat_traits<B>::template read_element<0>(b);
  18. quat_traits<A>::template write_element<1>(a) = quat_traits<B>::template read_element<1>(b);
  19. quat_traits<A>::template write_element<2>(a) = quat_traits<B>::template read_element<2>(b);
  20. quat_traits<A>::template write_element<3>(a) = quat_traits<B>::template read_element<3>(b);
  21. return a;
  22. }
  23. } }
  24. #endif