37 template <
typename UIntT>
38 constexpr uint8_t static_ilog2(UIntT x)
56 template <
typename UIntT>
57 constexpr UIntT static_align(UIntT x,
size_t al)
59 return UIntT((x % al == 0) ? x : (x/al + 1) * al);
70 template <
typename UIntT>
71 UIntT align(UIntT x,
size_t al)
73 return UIntT((x % al == 0) ? x : (x/al + 1) * al);
81 std::string qualified_type_name()
84 typedef typename std::remove_reference_t<T> TR;
86 std::string name(
typeid(TR).name());
88 if constexpr(std::is_const_v<TR>) {
91 if constexpr(std::is_volatile_v<TR>) {
94 if constexpr(std::is_lvalue_reference_v<T>) {
97 if constexpr(std::is_rvalue_reference_v<T>) {
104 template <
typename T>
105 inline void hash_combine(
size_t& s,
const T& v)
108 s ^= std::hash<T>()(v) + 0x9e3779b9 + (s << 6) + (s >> 2);
115 inline std::string DumpByteArray(
const char* data,
size_t size)
118 return std::string();
121 const char* hexDigits =
"0123456789ABCDEF";
123 const uint8_t* udata = (
const uint8_t*) data;
126 dump.append({hexDigits[udata[0]/16], hexDigits[udata[0]%16]});
128 for (
size_t i = 1 ; i < size ; i++) {
129 unsigned char c = udata[i];
130 dump.append({
' ', hexDigits[c/16], hexDigits[c%16]});
146 template <
typename... TypeT>
153 template <
typename TypeT>