[ox/std] Add toLittleEndian and toBigEndian functions
This commit is contained in:
parent
c0081619e6
commit
28960dd680
10
deps/ox/src/ox/std/byteswap.hpp
vendored
10
deps/ox/src/ox/std/byteswap.hpp
vendored
@ -63,6 +63,16 @@ constexpr T conditionalByteSwap(T i) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr T toLittleEndian(T i) noexcept {
|
||||||
|
return conditionalByteSwap<T, defines::BigEndian>(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
constexpr T toBigEndian(T i) noexcept {
|
||||||
|
return conditionalByteSwap<T, defines::BigEndian>(i);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T, bool byteSwap>
|
template<typename T, bool byteSwap>
|
||||||
class OX_PACKED ByteSwapInteger {
|
class OX_PACKED ByteSwapInteger {
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user