quat_assign.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef UUID_86A42DA4385511E7822024B881262D2E
  5. #define UUID_86A42DA4385511E7822024B881262D2E
  6. #include <boost/qvm/inline.hpp>
  7. #include <boost/qvm/enable_if.hpp>
  8. #include <boost/qvm/quat_traits.hpp>
  9. namespace
  10. boost
  11. {
  12. namespace
  13. qvm
  14. {
  15. template <class A,class B>
  16. BOOST_QVM_INLINE_OPERATIONS
  17. typename enable_if_c<
  18. is_quat<A>::value && is_quat<B>::value,
  19. A &>::type
  20. assign( A & a, B const & b )
  21. {
  22. quat_traits<A>::template write_element<0>(a) = quat_traits<B>::template read_element<0>(b);
  23. quat_traits<A>::template write_element<1>(a) = quat_traits<B>::template read_element<1>(b);
  24. quat_traits<A>::template write_element<2>(a) = quat_traits<B>::template read_element<2>(b);
  25. quat_traits<A>::template write_element<3>(a) = quat_traits<B>::template read_element<3>(b);
  26. return a;
  27. }
  28. }
  29. }
  30. #endif