]>
Commit | Line | Data |
---|---|---|
3a9019d9 FG |
1 | //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.\r |
2 | \r | |
3 | //Distributed under the Boost Software License, Version 1.0. (See accompanying\r | |
4 | //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r | |
5 | \r | |
6 | #include <boost/qvm/quat_operations.hpp>\r | |
7 | #include <boost/qvm/quat.hpp>\r | |
8 | #include "test_qvm_quaternion.hpp"\r | |
9 | #include "gold.hpp"\r | |
10 | \r | |
11 | namespace\r | |
12 | {\r | |
13 | template <class T,class U> struct same_type_tester;\r | |
14 | template <class T> struct same_type_tester<T,T> { };\r | |
15 | template <class T,class U> void test_same_type( T, U ) { same_type_tester<T,U>(); }\r | |
16 | \r | |
17 | void\r | |
18 | test()\r | |
19 | {\r | |
20 | using namespace boost::qvm::sfinae;\r | |
21 | test_qvm::quaternion<Q1> const x(42,1);\r | |
22 | test_qvm::scalar_multiply_v(x.b,x.a,2);\r | |
23 | test_same_type(x,x*2);\r | |
24 | {\r | |
25 | test_qvm::quaternion<Q1> y=x*2;\r | |
26 | BOOST_QVM_TEST_EQ(x.b,y.a);\r | |
27 | }\r | |
28 | {\r | |
29 | test_qvm::quaternion<Q1> y=qref(x)*2;\r | |
30 | BOOST_QVM_TEST_EQ(x.b,y.a);\r | |
31 | }\r | |
32 | }\r | |
33 | }\r | |
34 | \r | |
35 | int\r | |
36 | main()\r | |
37 | {\r | |
38 | test();\r | |
39 | return boost::report_errors();\r | |
40 | }\r |