mitteLib
Loading...
Searching...
No Matches
RawConversion

Functions

template<class Num , std::size_t NBytes>
constexpr Num mlab::lsb_unsigned_decode (std::array< std::uint8_t, NBytes > b)
 
template<class Num , std::size_t NBytes, std::size_t I = NBytes - 1>
constexpr Num mlab::msb_unsigned_decode (std::array< std::uint8_t, NBytes > b)
 
template<class Num , std::size_t NBytes>
constexpr std::array< std::uint8_t, NBytes > mlab::lsb_unsigned_encode (Num n)
 
template<class Num , std::size_t NBytes>
constexpr std::array< std::uint8_t, NBytes > mlab::msb_unsigned_encode (Num n)
 

Detailed Description

Note
There is apparently no better way to obtain this in C++14

Lower level functions which operate on an arbitrary unsigned integer.

Function Documentation

◆ lsb_unsigned_decode()

template<class Num , std::size_t NBytes>
Num mlab::lsb_unsigned_decode ( std::array< std::uint8_t, NBytes > b)
nodiscardconstexpr

◆ lsb_unsigned_encode()

template<class Num , std::size_t NBytes>
std::array< std::uint8_t, NBytes > mlab::lsb_unsigned_encode ( Num n)
nodiscardconstexpr

◆ msb_unsigned_decode()

template<class Num , std::size_t NBytes, std::size_t I = NBytes - 1>
Num mlab::msb_unsigned_decode ( std::array< std::uint8_t, NBytes > b)
nodiscardconstexpr

◆ msb_unsigned_encode()

template<class Num , std::size_t NBytes>
std::array< std::uint8_t, NBytes > mlab::msb_unsigned_encode ( Num n)
nodiscardconstexpr