div_eq_vs_test.cpp 719 B

123456789101112131415161718192021222324252627282930313233
  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_operations.hpp>
  5. #include "test_qvm_vector.hpp"
  6. #include "gold.hpp"
  7. namespace
  8. {
  9. template <int Dim>
  10. void
  11. test()
  12. {
  13. using namespace boost::qvm::sfinae;
  14. test_qvm::vector<V1,Dim> x(42,1);
  15. test_qvm::scalar_multiply_v(x.b,x.a,0.5f);
  16. x/=2;
  17. BOOST_QVM_TEST_EQ(x.a,x.b);
  18. }
  19. }
  20. int
  21. main()
  22. {
  23. test<1>();
  24. test<2>();
  25. test<3>();
  26. test<4>();
  27. test<5>();
  28. return boost::report_errors();
  29. }