diff --git a/platform/Span.h b/platform/Span.h index eb46c8afb4..3e04b1ea92 100644 --- a/platform/Span.h +++ b/platform/Span.h @@ -45,14 +45,6 @@ public: static const bool value = sizeof(true_type) == sizeof(sink(generator())); }; -template -struct enable_if; - -template -struct enable_if { - typedef ResultType type; -}; - } /** @@ -309,13 +301,14 @@ struct Span { * @note OtherElementType(*)[] should be convertible to ElementType(*)[]. */ template - Span( - const Span &other, - typename span_detail::enable_if< - span_detail::is_convertible::value - >::type* = 0 - ): - _data(other.data()) { } + Span(const Span &other): + _data(other.data()) + { + MBED_STATIC_ASSERT( + (span_detail::is_convertible::value), + "OtherElementType(*)[] should be convertible to ElementType (*)[]" + ); + } /** * Return the size of the sequence viewed. @@ -499,7 +492,6 @@ private: */ template struct Span { - /** * Type of the element contained */ @@ -598,13 +590,14 @@ struct Span { * @note OtherElementType(*)[] should be convertible to ElementType(*)[]. */ template - Span( - const Span &other, - typename span_detail::enable_if< - span_detail::is_convertible::value - >::type* = NULL - ): - _data(other.data()), _size(other.size()) { } + Span(const Span &other): + _data(other.data()), _size(other.size()) + { + MBED_STATIC_ASSERT( + (span_detail::is_convertible::value), + "OtherElementType(*)[] should be convertible to ElementType (*)[]" + ); + } /** * Return the size of the array viewed.