30#define CHECK_TYPE_INTEGRAL(Type) \
32 std::is_integral<Type>::value, \
33 #Type " must be an integral type, consider adding MemberTraits" \
40 template <
class T,
class U>
41 struct IsSameSignedness
43 enum { value = (
static_cast<bool>(std::is_signed<T>::value) ==
static_cast<bool>(std::is_signed<U>::value)) };
50 template<
typename U>
struct SFINAE {};
52 template<
typename U>
static int test(...);
53 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
60 template<
typename U>
struct SFINAE {};
62 template<
typename U>
static int test(...);
65 value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char)
73 enum { value = HasMantissa<T>::value && HasExponent<T>::value };
82 struct AreBothDecimals
84 enum { value = IsDecimal<Decimal1>::value && IsDecimal<Decimal2>::value };
89 struct HasMemberTraits
91 template<
typename U>
struct SFINAE {};
93 template<
typename U>
static int test(...);
94 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
99 struct HasValueStaticMember
101 template<
typename U,
typename U::Value (*)()>
struct SFINAE {};
103 template<
typename U>
static int test(...);
104 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
109 struct HasSerializeMember
111 template<
typename U,
void (U::*)(
void*) const noexcept>
struct SFINAE {};
113 template<
typename U>
static int test(...);
114 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
123 template<
typename U>
static int test(...);
124 enum { value =
sizeof(test<T>(
nullptr)) ==
sizeof(
char) };
129template <
typename Set,
typename NullValue>
130typename std::enable_if<details::HasBitsMember<Set>::value,
bool>::type
131operator != (NullValue null, Set set)
noexcept
136 return set.bits() != null;
140template <
class To,
class From>
143typename std::enable_if<details::IsSameSignedness<To, From>::value, To>::type
144 numericCast(From from)
noexcept
146 const To to =
static_cast<To
>(from);
148 assert(
static_cast<From
>(to) == from);
154template <
class To,
class From>
157typename std::enable_if<!details::IsSameSignedness<To, From>::value, To>::type
158 numericCast(From from)
noexcept
160 const To to =
static_cast<To
>(from);
162 assert(
static_cast<From
>(to) == from);
165 assert((to >
static_cast<To
>(0)) == (from >
static_cast<From
>(0)));
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_END
#define ONIXS_B3_UMDF_MD_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_B3_UMDF_MD_STATIC_ASSERT(X)