32template <
bool B,
class T =
void>
33using EnableIf = std::enable_if<B, T>;
36template <
typename Base,
typename Derived>
37using IsBaseOf = std::is_base_of<Base, Derived>;
41using IsSigned = std::is_signed<T>;
43#define CHECK_TYPE_INTEGRAL(Type) \
45 std::is_integral<Type>::value, \
46 #Type " must be an integral type, consider adding MemberTraits" \
53 template <
class T,
class U>
54 struct IsSameSignedness
56 enum { value = (
static_cast<bool>(IsSigned<T>::value) ==
static_cast<bool>(IsSigned<U>::value)) };
63 template<
typename U>
struct SFINAE {};
65 template<
typename U>
static int test(...);
66 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
73 template<
typename U>
struct SFINAE {};
75 template<
typename U>
static int test(...);
76 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
83 enum { value = HasMantissa<T>::value && HasExponent<T>::value };
92 struct AreBothDecimals
94 enum { value = IsDecimal<Decimal1>::value && IsDecimal<Decimal2>::value };
99 struct HasMemberTraits
103 template<
typename U>
static int test(...);
104 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
109 struct HasValueStaticMember
111 template<
typename U,
typename U::Value (*)()>
struct SFINAE {};
113 template<
typename U>
static int test(...);
114 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
119 struct HasSerializeMember
121 template<
typename U,
void (U::*)(
void*) const noexcept>
struct SFINAE {};
123 template<
typename U>
static int test(...);
124 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
129template <
class To,
class From>
132typename EnableIf<details::IsSameSignedness<To, From>::value, To>::type
133 numericCast(From from)
noexcept
136 static_cast<To
>(from);
138 assert(
static_cast<From
>(to) == from);
144template <
class To,
class From>
147typename EnableIf<!details::IsSameSignedness<To, From>::value, To>::type
148 numericCast(From from)
noexcept
151 static_cast<To
>(from);
153 assert(
static_cast<From
>(to) == from);
156 assert((to >
static_cast<To
>(0)) == (from >
static_cast<From
>(0)));
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ILINK3_PURE