8#ifndef TRITON_CORE_UTIL_H
9#define TRITON_CORE_UTIL_H
16#include <triton/config.hpp>
60 return static_cast<T
>(value);
66 return static_cast<T
>(value);
73 static_assert(not std::is_same<T, T>::value,
"cast have no implementation for this type");
86 std::enable_if_t<std::is_unsigned_v<T>, T> byteswap(T value) {
87 std::array<std::byte,
sizeof(value)> repr;
88 std::memcpy(&repr, &value,
sizeof(value));
89 std::reverse(repr.begin(), repr.end());
91 std::memcpy(&result, &repr,
sizeof(result));
std::uint8_t uint8
unisgned 8-bits
TRITON_EXPORT void fromUintToBuffer(triton::uint80 value, triton::uint8 *buffer)
Inject the value into the buffer. Make sure that the buffer contains at least 10 allocated bytes.
constexpr T cast(const triton::uint512 &value)
Casts an triton::uint512 to T.
std::string toString(const T &obj)
Converts an object to a string.