aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-30 10:06:12 -0700
committerChris Robinson <[email protected]>2019-05-30 10:06:12 -0700
commit1961828d0bde4ea67b6a24a10f4fedacc88b6392 (patch)
treec6845c493ef1d9d88557a715e6191f6be42f3963
parent153f133435fe46a94eb4d26c0483f4e6166fb896 (diff)
Avoid potentially ambiguous span copy constructor
-rw-r--r--common/alspan.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/alspan.h b/common/alspan.h
index bd6b53bb..d02b13f2 100644
--- a/common/alspan.h
+++ b/common/alspan.h
@@ -116,7 +116,7 @@ public:
constexpr span(U &cont) : span{al::data(cont), al::size(cont)} { }
template<typename U, REQUIRES(IS_VALID_CONTAINER(U))>
constexpr span(const U &cont) : span{al::data(cont), al::size(cont)} { }
- template<typename U, size_t N, REQUIRES(extent == N && std::is_convertible<U(*)[],element_type(*)[]>::value)>
+ template<typename U, size_t N, REQUIRES(!std::is_same<element_type,U>::value && extent == N && std::is_convertible<U(*)[],element_type(*)[]>::value)>
constexpr span(const span<U,N> &span_) noexcept : span{al::data(span_), al::size(span_)} { }
constexpr span(const span&) noexcept = default;
@@ -210,7 +210,7 @@ public:
constexpr span(U &cont) : span{al::data(cont), al::size(cont)} { }
template<typename U, REQUIRES(IS_VALID_CONTAINER(U))>
constexpr span(const U &cont) : span{al::data(cont), al::size(cont)} { }
- template<typename U, size_t N, REQUIRES(std::is_convertible<U(*)[],element_type(*)[]>::value)>
+ template<typename U, size_t N, REQUIRES((!std::is_same<element_type,U>::value || extent != N) && std::is_convertible<U(*)[],element_type(*)[]>::value)>
constexpr span(const span<U,N> &span_) noexcept : span{al::data(span_), al::size(span_)} { }
constexpr span(const span&) noexcept = default;