mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
renaming extent to prevent shadowing of static member
This commit is contained in:
parent
552cd20472
commit
d3468230b1
@ -420,24 +420,24 @@ public:
|
||||
constexpr span() noexcept : storage_(nullptr, details::extent_type<0>())
|
||||
{}
|
||||
|
||||
template<std::size_t extent = Extent, std::enable_if_t<extent != gsl::dynamic_extent, int> = 0>
|
||||
template<std::size_t SpanExtent = Extent, std::enable_if_t<SpanExtent != gsl::dynamic_extent, int> = 0>
|
||||
constexpr explicit span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
||||
{
|
||||
Expects(count == Extent);
|
||||
}
|
||||
|
||||
template<std::size_t extent = Extent, std::enable_if_t<extent == gsl::dynamic_extent, int> = 0>
|
||||
template<std::size_t SpanExtent = Extent, std::enable_if_t<SpanExtent == gsl::dynamic_extent, int> = 0>
|
||||
constexpr span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
||||
{}
|
||||
|
||||
template<std::size_t extent = Extent, std::enable_if_t<extent != gsl::dynamic_extent, int> = 0>
|
||||
template<std::size_t SpanExtent = Extent, std::enable_if_t<SpanExtent != gsl::dynamic_extent, int> = 0>
|
||||
constexpr explicit span(pointer firstElem, pointer lastElem) noexcept
|
||||
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
||||
{
|
||||
Expects(lastElem - firstElem == static_cast<difference_type>(Extent));
|
||||
}
|
||||
|
||||
template<std::size_t extent = Extent, std::enable_if_t<extent == gsl::dynamic_extent, int> = 0>
|
||||
template<std::size_t SpanExtent = Extent, std::enable_if_t<SpanExtent == gsl::dynamic_extent, int> = 0>
|
||||
constexpr span(pointer firstElem, pointer lastElem) noexcept
|
||||
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
||||
{}
|
||||
@ -492,9 +492,9 @@ public:
|
||||
constexpr span(const span& other) noexcept = default;
|
||||
|
||||
template <
|
||||
class OtherElementType, std::size_t OtherExtent, std::size_t MyExtent = Extent,
|
||||
class OtherElementType, std::size_t OtherExtent, std::size_t SpanExtent = Extent,
|
||||
std::enable_if_t<
|
||||
!(MyExtent != dynamic_extent && OtherExtent == dynamic_extent) &&
|
||||
!(SpanExtent != dynamic_extent && OtherExtent == dynamic_extent) &&
|
||||
(Extent == dynamic_extent || OtherExtent == dynamic_extent || Extent == OtherExtent) &&
|
||||
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value, int> = 0>
|
||||
constexpr span(const span<OtherElementType, OtherExtent>& other) noexcept
|
||||
@ -502,9 +502,9 @@ public:
|
||||
{}
|
||||
|
||||
template <
|
||||
class OtherElementType, std::size_t OtherExtent, std::size_t MyExtent = Extent,
|
||||
class OtherElementType, std::size_t OtherExtent, std::size_t SpanExtent = Extent,
|
||||
std::enable_if_t<
|
||||
(MyExtent != dynamic_extent && OtherExtent == dynamic_extent) &&
|
||||
(SpanExtent != dynamic_extent && OtherExtent == dynamic_extent) &&
|
||||
(Extent == dynamic_extent || OtherExtent == dynamic_extent || Extent == OtherExtent) &&
|
||||
details::is_allowed_element_type_conversion<OtherElementType, element_type>::value, int> = 0>
|
||||
constexpr explicit span(const span<OtherElementType, OtherExtent>& other) noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user