diff --git a/include/etl/span.h b/include/etl/span.h index 8d03e5fb..a313b54b 100644 --- a/include/etl/span.h +++ b/include/etl/span.h @@ -55,11 +55,13 @@ SOFTWARE. namespace etl { + //empty base optimization means this has zero size + class span_base {}; //*************************************************************************** /// Span - Fixed Extent //*************************************************************************** template - class span + class span : public span_base { public: @@ -113,7 +115,8 @@ namespace etl /// Construct from a container or other type that supports /// data() and size() member functions. //************************************************************************* - template >::value && + template >::value && + !etl::is_pointer>::value && !etl::is_array>::value&& etl::is_same, etl::remove_cv_t::value_type>>::value, void>::type> ETL_CONSTEXPR span(TContainer&& a) ETL_NOEXCEPT @@ -158,7 +161,7 @@ namespace etl /// Copy constructor //************************************************************************* template - ETL_CONSTEXPR span(const etl::span& other, typename etl::enable_if<(Extent == etl::dynamic_extent) || (N == etl::dynamic_extent) || (N == Extent), void>::type) ETL_NOEXCEPT + ETL_CONSTEXPR span(const etl::span& other, typename etl::enable_if<(Extent == etl::dynamic_extent) || (N == etl::dynamic_extent) || (N == Extent), void>::type* = 0) ETL_NOEXCEPT : pbegin(other.data()) { } @@ -511,7 +514,8 @@ namespace etl /// Construct from a container or other type that supports /// data() and size() member functions. //************************************************************************* - template >::value && + template >::value && + !etl::is_pointer>::value && !etl::is_array>::value && etl::is_same, etl::remove_cv_t::value_type>>::value, void>::type> ETL_CONSTEXPR span(TContainer&& a) ETL_NOEXCEPT