5 # ifndef VCCC_MATH_MATRIX_TYPE_HELPER_HPP
6 # define VCCC_MATH_MATRIX_TYPE_HELPER_HPP
8 # include <type_traits>
17 struct hold_type_selector {
19 std::conditional_t<bool(static_cast<int>(traits<T>::option) &
static_cast<int>(Flag::kReferenceUnsafe)),
20 const std::remove_reference_t<T>,
22 using non_const_type =
23 std::conditional_t<bool(static_cast<int>(traits<T>::option) &
static_cast<int>(Flag::kReferenceUnsafe)),
24 std::remove_reference_t<T>,
29 using hold_type_selector_t =
typename hold_type_selector<T>::type;
32 struct is_alias_safe : std::integral_constant<bool, !(static_cast<int>(traits<T>::option) & static_cast<int>(Flag::kAliasUnsafe))> {};
34 template<
typename T>
using is_alias_safe_t =
typename is_alias_safe<T>::type;
38 struct is_concrete_matrix : std::false_type {};
40 template<
typename T,
int m,
int n>
41 struct is_concrete_matrix<Matrix<T, m, n>> : std::true_type {};
44 using is_concrete_matrix_t =
typename is_concrete_matrix<T>::type;
46 template<
typename TL,
typename TR>
47 struct is_same_size_impl
48 : std::integral_constant<bool, ((static_cast<int>(TL::rows) == static_cast<int>(TR::rows)) && (static_cast<int>(TL::cols) == static_cast<int>(TR::cols)))> {};
50 template<
typename A,
typename B>
51 struct is_same_size : is_same_size_impl<traits<A>, traits<B>> {};
53 template<
typename TL,
typename TR>
54 struct is_same_type_impl : std::is_same<typename TL::value_type, typename TR::value_type> {};
56 template<
typename A,
typename B>
57 struct is_same_type : is_same_type_impl<traits<A>, traits<B>> {};
Definition: directory.h:12