ソースを参照

Fixing compiler error caused by ambiguous function definition when trying to multiply:
math::matrix::matrix<double, 4, 4>() * math::vector::vector<double, 3>()

Sam Jaffe 7 年 前
コミット
2d74e5c1b4
1 ファイル変更6 行追加0 行削除
  1. 6 0
      vector.hpp

+ 6 - 0
vector.hpp

@@ -18,6 +18,10 @@
 
 #include "expect/expect.hpp"
 
+namespace math { namespace matrix {
+  template <typename, size_t, size_t> class matrix;
+} }
+
 namespace math { namespace vector {
 #define VECTOR_ENABLE_IF_LT_N(index, expr) \
 template <bool _ = true> \
@@ -50,6 +54,8 @@ VECTOR_ENABLE_IF_LT_N(i, value_type &) name() { return _data[i]; }
   class vector;
   template <typename T, std::size_t N>
   struct is_vector<vector<T, N>> { static const constexpr bool value = true; };
+  template <typename T, std::size_t R, std::size_t C>
+  struct is_vector<matrix::matrix<T, R, C>> { static const constexpr bool value = true; };
   
   template <typename T, std::size_t N>
   class vector {