24 #include <type_traits>
29 template <
typename A,
size_t N>
30 using Tuple = std::array<A, N>;
39 #ifndef RAM_DOMAIN_SIZE
40 #define RAM_DOMAIN_SIZE 32
43 #if RAM_DOMAIN_SIZE == 64
58 static_assert(std::is_integral<RamSigned>::value && std::is_signed<RamSigned>::value,
59 "RamSigned must be represented by a signed type.");
60 static_assert(std::is_integral<RamUnsigned>::value && !std::is_signed<RamUnsigned>::value,
61 "RamUnsigned must be represented by an unsigned type.");
63 "RamFloat must be represented by a floating point and have the same size as other types.");
66 constexpr
bool isRamType = (std::is_same<T, RamDomain>::value || std::is_same<T, RamSigned>::value ||
67 std::is_same<T, RamUnsigned>::value || std::is_same<T, RamFloat>::value);
80 template <
typename To = RamDomain,
typename From>
82 static_assert(isRamType<From> && isRamType<To>,
"Bit casting should only be used on Ram Types.");
83 static_assert(
sizeof(To) ==
sizeof(From),
"Can't bit cast types with different size.");
85 memcpy(&destination, &source,
sizeof(destination));