traits.hpp 486 B

123456789101112131415161718192021
  1. #pragma once
  2. #include "math/matrix/forward.h"
  3. namespace math::matrix {
  4. template <typename T> struct is_matrix {
  5. static const constexpr bool value = false;
  6. };
  7. template <typename T, size_t R, size_t C> struct is_matrix<matrix<T, R, C>> {
  8. static const constexpr bool value = true;
  9. };
  10. template <typename T, size_t N> struct is_matrix<vector::vector<T, N>> {
  11. static const constexpr bool value = true;
  12. };
  13. template <typename T> constexpr bool is_matrix_v = is_matrix<T>::value;
  14. }