]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/mul_sv_test.cpp
update sources to v12.2.4
[ceph.git] / ceph / src / boost / libs / qvm / test / mul_sv_test.cpp
CommitLineData
b32b8144
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/vec_operations.hpp>\r
7#include <boost/qvm/vec.hpp>\r
8#include "test_qvm_vector.hpp"\r
9#include "gold.hpp"\r
10\r
11namespace\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 template <int Dim>\r
18 void\r
19 test()\r
20 {\r
21 using namespace boost::qvm::sfinae;\r
22 test_qvm::vector<V1,Dim> const x(42,1);\r
23 test_qvm::scalar_multiply_v(x.b,x.a,2.0f);\r
24 test_same_type(x,2*x);\r
25 {\r
26 test_qvm::vector<V1,Dim> y=2*x;\r
27 BOOST_QVM_TEST_EQ(x.b,y.a);\r
28 }\r
29 {\r
30 test_qvm::vector<V1,Dim> y=2*vref(x);\r
31 BOOST_QVM_TEST_EQ(x.b,y.a);\r
32 }\r
33 }\r
34 }\r
35\r
36int\r
37main()\r
38 {\r
39 test<1>();\r
40 test<2>();\r
41 test<3>();\r
42 test<4>();\r
43 test<5>();\r
44 return boost::report_errors();\r
45 }\r