From 5231bec423a077041527fbdeaccbe47e76539df7 Mon Sep 17 00:00:00 2001 From: Marc Emmers Date: Mon, 9 Nov 2020 15:45:16 +0100 Subject: [PATCH] Fix remaining namespaces and add include files --- platform/cxxsupport/mstd_span | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/platform/cxxsupport/mstd_span b/platform/cxxsupport/mstd_span index 8503fdb234..848e8b8976 100644 --- a/platform/cxxsupport/mstd_span +++ b/platform/cxxsupport/mstd_span @@ -17,8 +17,10 @@ #ifndef MSTD_SPAN_ #define MSTD_SPAN_ +#include #include #include +#include "mbed_assert.h" namespace mstd { @@ -55,29 +57,29 @@ public: }; template -struct is_span: false_type {}; +struct is_span: std::false_type {}; template -struct is_span>: true_type {}; +struct is_span>: std::true_type {}; template -struct is_std_array: false_type {}; +struct is_std_array: std::false_type {}; template -struct is_std_array>: true_type {}; +struct is_std_array>: std::true_type {}; template struct has_size : std::false_type {}; template -struct has_size()))>>: +struct has_size()))>>: std::true_type {}; template struct has_data : std::false_type {}; template -struct has_data()))>>: +struct has_data()))>>: std::true_type {}; template> @@ -89,7 +91,7 @@ struct is_container{ }; template -using iterator_t = decltype(mstd::begin(mstd::declval())); +using iterator_t = decltype(mstd::begin(std::declval())); template using range_reference_t = mstd::iter_reference_t>; @@ -101,10 +103,10 @@ template struct is_compatible())) + decltype(mstd::data(std::declval())) >, void>::value>>: mstd::is_convertible()))> (*)[], E (*)[]>{}; + decltype(mstd::data(std::declval()))> (*)[], E (*)[]>{}; } // namespace detail @@ -160,7 +162,7 @@ public: {} template - constexpr span(array& arr, + constexpr span(std::array& arr, typename mstd::enable_if_t<(Extent == dynamic_extent || Extent == N) && mstd::is_convertible(*)[], ElementType(*)[]>::value, int> = 0) noexcept: @@ -168,7 +170,7 @@ public: {} template - constexpr span(const array& arr, + constexpr span(const std::array& arr, typename mstd::enable_if_t<(Extent == dynamic_extent || Extent == N) && mstd::is_convertible(*)[], ElementType(*)[]>::value, int> = 0) noexcept: @@ -188,7 +190,7 @@ public: template::value, int> = 0> + mstd::is_convertible::value, int> = 0> constexpr span(const span& s) noexcept: _storage(s.data(), s.size()) {} @@ -337,13 +339,13 @@ constexpr span make_span(const ElementType (&arr)[Ext } template -constexpr span make_span(array& arr) +constexpr span make_span(std::array& arr) { return span(arr); } template -constexpr span make_span(const array& arr) +constexpr span make_span(const std::array& arr) { return span(arr); }