mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Removed use of is_const_v and is_convertible_v in span so things work on older compilers
This commit is contained in:
parent
cdd9ee5a6a
commit
2f19b410ff
@ -361,7 +361,7 @@ public:
|
|||||||
template <std::size_t N, class ArrayElementType = std::remove_const_t<element_type>,
|
template <std::size_t N, class ArrayElementType = std::remove_const_t<element_type>,
|
||||||
class = std::enable_if_t<
|
class = std::enable_if_t<
|
||||||
( extent == dynamic_extent || N == extent ) &&
|
( extent == dynamic_extent || N == extent ) &&
|
||||||
std::is_convertible_v<std::add_pointer_t<ArrayElementType>, pointer>
|
std::is_convertible<std::add_pointer_t<ArrayElementType>, pointer>::value
|
||||||
>>
|
>>
|
||||||
constexpr span( std::array<ArrayElementType, N>& arr )
|
constexpr span( std::array<ArrayElementType, N>& arr )
|
||||||
: storage_(&arr[0], details::extent_type<N>())
|
: storage_(&arr[0], details::extent_type<N>())
|
||||||
@ -371,8 +371,8 @@ public:
|
|||||||
template <std::size_t N,
|
template <std::size_t N,
|
||||||
class = std::enable_if_t<
|
class = std::enable_if_t<
|
||||||
( extent == dynamic_extent || N == extent ) &&
|
( extent == dynamic_extent || N == extent ) &&
|
||||||
std::is_const_v<element_type> &&
|
std::is_const<element_type>::value &&
|
||||||
std::is_convertible_v<std::add_pointer_t<element_type>, pointer>
|
std::is_convertible<std::add_pointer_t<element_type>, pointer>::value
|
||||||
>>
|
>>
|
||||||
constexpr span(const std::array<std::remove_const_t<element_type>, N>& arr) GSL_NOEXCEPT
|
constexpr span(const std::array<std::remove_const_t<element_type>, N>& arr) GSL_NOEXCEPT
|
||||||
: storage_(&arr[0], details::extent_type<N>())
|
: storage_(&arr[0], details::extent_type<N>())
|
||||||
|
Loading…
Reference in New Issue
Block a user