33 std::remove_pointer_t<
34 std::remove_reference_t<
35 std::remove_cv_t<T>>>;
37 template <
class To,
class From>
38 struct types_are_compat :
42 template <
class To,
class From>
43 struct types_are_compat<To&, From> :
44 std::is_lvalue_reference<
45 std::remove_cv_t<From>>
48 template <
class To,
class From>
49 struct types_are_compat<To*, From> :
51 std::remove_cv_t<From>>
54 template <
class Base,
class Derived>
55 struct is_base_of_no_cvpr :
58 remove_cvpr_t<Derived>>
61 template <
class T,
class Enable =
void>
67 struct _has_rtti<T,
std::void_t<decltype(T::Ni_RTTI)>> :
73 _has_rtti<remove_cvpr_t<T>>
76 template <
class To,
class From>
77 struct cast_is_valid :
79 types_are_compat<To, From>,
80 is_base_of_no_cvpr<From, To>,
85 template <
class To,
class From>
86 inline constexpr bool cast_is_valid_v = cast_is_valid<To, From>::value;