traits.hpp 466 B

12345678910111213141516171819
  1. #pragma once
  2. namespace math::vector {
  3. template <typename T> struct is_vector {
  4. static const constexpr bool value = false;
  5. };
  6. template <typename T, std::size_t N> struct is_vector<vector<T, N>> {
  7. static const constexpr bool value = true;
  8. };
  9. template <typename T, std::size_t R, std::size_t C>
  10. struct is_vector<matrix::matrix<T, R, C>> {
  11. static const constexpr bool value = true;
  12. };
  13. template <typename T> constexpr bool is_vector_v = is_vector<T>::value;
  14. }