swizzle3_test3.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/qvm/vec_traits.hpp>
  5. #include <boost/qvm/swizzle3.hpp>
  6. #include <boost/detail/lightweight_test.hpp>
  7. template <int D> struct my_vec { };
  8. int called=0;
  9. namespace
  10. boost
  11. {
  12. namespace
  13. qvm
  14. {
  15. void
  16. YYY(...)
  17. {
  18. BOOST_TEST(0);
  19. }
  20. void
  21. XXZ(...)
  22. {
  23. ++called;
  24. }
  25. template <int D>
  26. struct
  27. vec_traits< my_vec<D> >
  28. {
  29. typedef int scalar_type;
  30. static int const dim=D;
  31. template <int I> static int read_element( my_vec<D> const & );
  32. template <int I> static int & write_element( my_vec<D> & );
  33. };
  34. }
  35. }
  36. int
  37. main()
  38. {
  39. using namespace boost::qvm;
  40. YYY(my_vec<2>());
  41. XXZ(my_vec<2>());
  42. BOOST_TEST(called==1);
  43. return boost::report_errors();
  44. }