]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/swizzle2_test4.cpp
2b8f63f6ac0cc287a3cae1616a8fd9620669df0b
[ceph.git] / ceph / src / boost / libs / qvm / test / swizzle2_test4.cpp
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/vec_traits.hpp>
7 #include <boost/qvm/swizzle2.hpp>
8 #include <boost/detail/lightweight_test.hpp>
9
10 template <int D> struct my_vec { };
11 int called=0;
12
13 namespace
14 boost
15 {
16 namespace
17 qvm
18 {
19 void
20 ZZ(...)
21 {
22 BOOST_TEST(0);
23 }
24 void
25 XW(...)
26 {
27 ++called;
28 }
29 template <int D>
30 struct
31 vec_traits< my_vec<D> >
32 {
33 typedef int scalar_type;
34 static int const dim=D;
35 template <int I> static int read_element( my_vec<D> const & );
36 template <int I> static int & write_element( my_vec<D> & );
37 };
38 }
39 }
40
41 int
42 main()
43 {
44 using namespace boost::qvm;
45 ZZ(my_vec<3>());
46 XW(my_vec<3>());
47 BOOST_TEST(called==1);
48 return boost::report_errors();
49 }