]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/deduce_vector_test.cpp
update sources to v12.2.4
[ceph.git] / ceph / src / boost / libs / qvm / test / deduce_vector_test.cpp
CommitLineData
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/deduce_vec.hpp>\r
7\r
8template <class T,class U>\r
9struct same_type;\r
10\r
11template <class T>\r
12struct\r
13same_type<T,T>\r
14 {\r
15 };\r
16\r
17template <class A,class B,int D,class Result>\r
18struct\r
19check\r
20 {\r
21 same_type<typename boost::qvm::deduce_vec2<A,B,D>::type,Result> a;\r
22 same_type<typename boost::qvm::deduce_vec2<B,A,D>::type,Result> b;\r
23 };\r
24\r
25template <class T,int D> struct v;\r
26\r
27namespace\r
28boost\r
29 {\r
30 namespace\r
31 qvm\r
32 {\r
33 template <class T,int D>\r
34 struct\r
35 vec_traits< v<T,D> >\r
36 {\r
37 typedef T scalar_type;\r
38 static int const dim=D;\r
39 }; \r
40 }\r
41 }\r
42\r
43int\r
44main()\r
45 {\r
46 same_type< boost::qvm::deduce_vec< v<int,3> >::type, v<int,3> >();\r
47 same_type< boost::qvm::deduce_vec< v<int,3>, 4 >::type, boost::qvm::vec<int,4> >();\r
48 check< v<int,3>, v<int,3>, 3, v<int,3> >();\r
49 check< v<int,3>, v<float,3>, 4, boost::qvm::vec<float,4> >();\r
50 }\r