Fixes to byte_stream_reader for const data

This commit is contained in:
John Wellbelove 2021-09-29 18:49:27 +01:00
parent 05f17e1d74
commit f987d2a287
2 changed files with 14 additions and 3 deletions

View File

@ -374,6 +374,18 @@ namespace etl
{
}
//***************************************************************************
/// Construct from const array.
//***************************************************************************
template <typename T, size_t Size>
byte_stream_reader(const T(&begin_)[Size], etl::endian buffer_endianness_ = etl::endian::big)
: pdata(begin_)
, pcurrent(begin_)
, length(begin_ + (Size * sizeof(T)))
, buffer_endianness(buffer_endianness_)
{
}
//***************************************************************************
/// Read a value from the stream.
//***************************************************************************

View File

@ -41,10 +41,9 @@ SOFTWARE.
#include "array.h"
///\defgroup span span
/// A wrapper for arrays
///\ingroup containers
#if ETL_USING_STL
#if ETL_CPP11_SUPPORTED && ETL_USING_STL
#include <array>
#endif
@ -93,7 +92,7 @@ namespace etl
{
}
#if ETL_USING_STL
#if ETL_CPP11_SUPPORTED && ETL_USING_STL
//*************************************************************************
/// Construct from std::array.
//*************************************************************************