view: avoid alignment warnings for view extraction

It is assumed the user is on top of this.
This commit is contained in:
Danny Robson 2018-08-01 13:10:11 +10:00
parent 4b9b292848
commit 47c912e5e2

View File

@ -621,6 +621,8 @@ namespace util {
///
/// the buffer object is advanced in place so that it no longer covers
/// the extract value
///
/// it is assumed the user has taken care of alignment concerns
template <
typename ValueT,
typename ByteT,
@ -632,7 +634,7 @@ namespace util {
if (buffer.size () < sizeof (ValueT))
throw std::runtime_error ("insufficient data for view shift");
ValueT const &res = *reinterpret_cast<ValueT const*> (buffer.data ());
ValueT const &res = *util::cast::ffs<ValueT const*> (buffer.data ());
buffer = buffer.consume (sizeof (ValueT));
return res;
}