diff options
author | Chris Robinson <[email protected]> | 2019-05-30 18:39:51 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-30 18:39:51 -0700 |
commit | 4bae4cbafb36cd922492dbc1fb7a0cbc075592dc (patch) | |
tree | 946cb6c156c12edc9c62a8a0f4bba9608ab5c263 | |
parent | a123c87ba5a0ba48490ba1f8cd859e557e9bbb62 (diff) |
Another attempt to fix MSVC 2015
-rw-r--r-- | common/alspan.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/common/alspan.h b/common/alspan.h index 62f7b2ab..6b0dc7d6 100644 --- a/common/alspan.h +++ b/common/alspan.h @@ -108,12 +108,10 @@ public: constexpr span() noexcept { } constexpr span(pointer ptr, index_type /*count*/) : mData{ptr} { } constexpr span(pointer first, pointer /*last*/) : mData{first} { } - template<size_t N, REQUIRES(extent == N)> - constexpr span(element_type (&arr)[N]) noexcept : span{al::data(arr), al::size(arr)} { } - template<size_t N, REQUIRES(extent == N && USABLE_CONTAINER_DATA(std::array<value_type,N>&))> - constexpr span(std::array<value_type,N> &arr) noexcept : span{al::data(arr), al::size(arr)} { } - template<size_t N, REQUIRES(extent == N && USABLE_CONTAINER_DATA(const std::array<value_type,N>&))> - constexpr span(const std::array<value_type,N> &arr) noexcept : span{al::data(arr), al::size(arr)} { } + constexpr span(element_type (&arr)[E]) noexcept : span{al::data(arr), al::size(arr)} { } + constexpr span(std::array<value_type,E> &arr) noexcept : span{al::data(arr), al::size(arr)} { } + template<bool is_const=std::is_const<element_type>::value, REQUIRES(is_const)> + constexpr span(const std::array<value_type,E> &arr) noexcept : span{al::data(arr), al::size(arr)} { } template<typename U, REQUIRES(IS_VALID_CONTAINER(U))> constexpr span(U &cont) : span{al::data(cont), al::size(cont)} { } template<typename U, REQUIRES(IS_VALID_CONTAINER(const U))> @@ -204,9 +202,9 @@ public: constexpr span(pointer first, pointer last) : mData{first}, mDataEnd{last} { } template<size_t N> constexpr span(element_type (&arr)[N]) noexcept : span{al::data(arr), al::size(arr)} { } - template<size_t N, REQUIRES(USABLE_CONTAINER_DATA(std::array<value_type,N>&))> + template<size_t N> constexpr span(std::array<value_type,N> &arr) noexcept : span{al::data(arr), al::size(arr)} { } - template<size_t N, REQUIRES(USABLE_CONTAINER_DATA(const std::array<value_type,N>&))> + template<size_t N, bool is_const=std::is_const<element_type>::value, REQUIRES(is_const)> constexpr span(const std::array<value_type,N> &arr) noexcept : span{al::data(arr), al::size(arr)} { } template<typename U, REQUIRES(IS_VALID_CONTAINER(U))> constexpr span(U &cont) : span{al::data(cont), al::size(cont)} { } |