folly::constexprPartialLoadUnaligned

Read an unaligned value of type T and return it. Constexpr, but not optimized. Accepts inputs either of char-array types or char-backed enum-array types.

Synopsis

Declared in <folly/lang/Bits.h>

template<
    class T,
    class S>
constexpr
T
constexprPartialLoadUnaligned(
    S const* s,
    std::size_t l);

Return Value

The l low bytes read from s, as a value of type T.

Parameters

NameDescription
sPointer to the single-byte elements to read.
lThe number of bytes to read; must be less than sizeof(T).