]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/deduce_matrix_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / qvm / test / deduce_matrix_test.cpp
CommitLineData
92f5a8d4
TL
1//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
2
3//Distributed under the Boost Software License, Version 1.0. (See accompanying
4//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#include <boost/qvm/deduce_mat.hpp>
7
8template <class T,class U>
9struct same_type;
10
11template <class T>
12struct
13same_type<T,T>
14 {
15 };
16
17template <class A,class B,int R,int C,class Result>
18struct
19check
20 {
21 same_type<typename boost::qvm::deduce_mat2<A,B,R,C>::type,Result> a;
22 same_type<typename boost::qvm::deduce_mat2<B,A,R,C>::type,Result> b;
23 };
24
25template <class T,int R,int C> struct m;
26
27namespace
28boost
29 {
30 namespace
31 qvm
32 {
33 template <class T,int R,int C>
34 struct
35 mat_traits< m<T,R,C> >
36 {
37 typedef T scalar_type;
38 static int const rows=R;
39 static int const cols=C;
40 };
41 }
42 }
43
44int
45main()
46 {
47 same_type< boost::qvm::deduce_mat< m<int,4,2> >::type, m<int,4,2> >();
48 same_type< boost::qvm::deduce_mat< m<int,4,2>, 4, 4 >::type, boost::qvm::mat<int,4,4> >();
49 check< m<int,4,2>, m<int,4,2>, 4, 2, m<int,4,2> >();
50 check< m<int,4,2>, m<float,4,2>, 4, 4, boost::qvm::mat<float,4,4> >();
51 }