18 #ifndef ION_BASE_TYPE_STRUCTS_H_
19 #define ION_BASE_TYPE_STRUCTS_H_
45 template <
typename Base,
typename Derived>
struct IsBaseOf {
49 operator Base*()
const;
55 template <
typename T>
static char Test(Derived*,
T);
56 static int Test(Base*,
int);
59 template <
typename Base,
typename Derived>
66 template <
typename From,
typename To>
68 IsBaseOf<To, From>::value> {};
73 template<
bool condition,
typename A,
typename B>
75 template<
typename A,
typename B>
84 static const bool value = __has_trivial_destructor(
T);
92 #endif // ION_BASE_TYPE_STRUCTS_H_
IsBaseOf is similar to std::is_base_of.
static char Test(Derived *, T)
Overloaded function that chooses the Derived version iff Derived is actually derived from Base...
Because the Derived type-cast operator is non-const, it is preferred over the Base operator when call...
BoolType is a struct whose value member is either true or false.
ConditionalType is similar to std::conditional.
IsSameType is similar to std::is_same.
IsConvertible is similar to std::is_convertible, except that it only looks at direct inheritance rela...
HasTrivialDestructor is similar to std::has_trivial_destructor or std::is_trivially_destructible.