MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / big_to_native

Function big_to_native

include/jsoncons/utility/binary.hpp:167–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165
166 template <typename T,typename Endian=endian>
167 typename std::enable_if<Endian::native == Endian::big,T>::type
168 big_to_native(const uint8_t* first, std::size_t count)
169 {
170 if (sizeof(T) > count)
171 {
172 return T{};
173 }
174 T val;
175 std::memcpy(&val,first,sizeof(T));
176 return val;
177 }
178
179 template <typename T,typename Endian=endian>
180 typename std::enable_if<Endian::native == Endian::little,T>::type

Callers

nothing calls this directly

Calls 1

byte_swapFunction · 0.85

Tested by

no test coverage detected