]>
Commit | Line | Data |
---|---|---|
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_traits.hpp>\r | |
7 | #include <boost/qvm/swizzle3.hpp>\r | |
8 | #include <boost/detail/lightweight_test.hpp>\r | |
9 | \r | |
10 | template <int D> struct my_vec { };\r | |
11 | int called=0;\r | |
12 | \r | |
13 | namespace\r | |
14 | boost\r | |
15 | {\r | |
16 | namespace\r | |
17 | qvm\r | |
18 | {\r | |
19 | void\r | |
20 | YYY(...)\r | |
21 | {\r | |
22 | BOOST_TEST(0);\r | |
23 | }\r | |
24 | void\r | |
25 | XXZ(...)\r | |
26 | {\r | |
27 | ++called;\r | |
28 | }\r | |
29 | template <int D>\r | |
30 | struct\r | |
31 | vec_traits< my_vec<D> >\r | |
32 | {\r | |
33 | typedef int scalar_type;\r | |
34 | static int const dim=D;\r | |
35 | template <int I> static int read_element( my_vec<D> const & );\r | |
36 | template <int I> static int & write_element( my_vec<D> & );\r | |
37 | };\r | |
38 | }\r | |
39 | }\r | |
40 | \r | |
41 | int\r | |
42 | main()\r | |
43 | {\r | |
44 | using namespace boost::qvm;\r | |
45 | YYY(my_vec<2>());\r | |
46 | XXZ(my_vec<2>());\r | |
47 | BOOST_TEST(called==1);\r | |
48 | return boost::report_errors();\r | |
49 | }\r |