mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-30 23:34:59 -05:00
remove gsl namespace qualification within the gsl namespace
This commit is contained in:
parent
301030310e
commit
4c66cea06c
@ -100,7 +100,7 @@ namespace details
|
|||||||
|
|
||||||
template <std::size_t From, std::size_t To>
|
template <std::size_t From, std::size_t To>
|
||||||
struct is_allowed_extent_conversion
|
struct is_allowed_extent_conversion
|
||||||
: std::integral_constant<bool, From == To || To == gsl::dynamic_extent>
|
: std::integral_constant<bool, From == To || To == dynamic_extent>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -421,24 +421,24 @@ public:
|
|||||||
constexpr span() noexcept : storage_(nullptr, details::extent_type<0>())
|
constexpr span() noexcept : storage_(nullptr, details::extent_type<0>())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent != gsl::dynamic_extent, int> = 0>
|
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent != dynamic_extent, int> = 0>
|
||||||
constexpr explicit span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
constexpr explicit span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
||||||
{
|
{
|
||||||
Expects(count == Extent);
|
Expects(count == Extent);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent == gsl::dynamic_extent, int> = 0>
|
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent == dynamic_extent, int> = 0>
|
||||||
constexpr span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
constexpr span(pointer ptr, size_type count) noexcept : storage_(ptr, count)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent != gsl::dynamic_extent, int> = 0>
|
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent != dynamic_extent, int> = 0>
|
||||||
constexpr explicit span(pointer firstElem, pointer lastElem) noexcept
|
constexpr explicit span(pointer firstElem, pointer lastElem) noexcept
|
||||||
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
||||||
{
|
{
|
||||||
Expects(lastElem - firstElem == static_cast<difference_type>(Extent));
|
Expects(lastElem - firstElem == static_cast<difference_type>(Extent));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent == gsl::dynamic_extent, int> = 0>
|
template <std::size_t MyExtent = Extent, std::enable_if_t<MyExtent == dynamic_extent, int> = 0>
|
||||||
constexpr span(pointer firstElem, pointer lastElem) noexcept
|
constexpr span(pointer firstElem, pointer lastElem) noexcept
|
||||||
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
: storage_(firstElem, static_cast<std::size_t>(lastElem - firstElem))
|
||||||
{}
|
{}
|
||||||
|
@ -471,7 +471,7 @@ bool operator==(const T& one, const gsl::basic_string_span<CharT, Extent>& other
|
|||||||
}
|
}
|
||||||
|
|
||||||
// operator !=
|
// operator !=
|
||||||
template <typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
template <typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<std::is_convertible<
|
typename = std::enable_if_t<std::is_convertible<
|
||||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||||
bool operator!=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
bool operator!=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
||||||
@ -480,7 +480,7 @@ bool operator!=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
||||||
!gsl::details::is_basic_string_span<T>::value>>
|
!gsl::details::is_basic_string_span<T>::value>>
|
||||||
@ -490,7 +490,7 @@ bool operator!=(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// operator<
|
// operator<
|
||||||
template <typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
template <typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<std::is_convertible<
|
typename = std::enable_if_t<std::is_convertible<
|
||||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||||
bool operator<(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
bool operator<(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
||||||
@ -500,7 +500,7 @@ bool operator<(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
||||||
!gsl::details::is_basic_string_span<T>::value>>
|
!gsl::details::is_basic_string_span<T>::value>>
|
||||||
@ -516,7 +516,7 @@ bool operator<(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
// so the cases below are already covered by the previous operators
|
// so the cases below are already covered by the previous operators
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -530,7 +530,7 @@ bool operator<(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -545,7 +545,7 @@ bool operator<(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// operator <=
|
// operator <=
|
||||||
template <typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
template <typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<std::is_convertible<
|
typename = std::enable_if_t<std::is_convertible<
|
||||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||||
bool operator<=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
bool operator<=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
||||||
@ -554,7 +554,7 @@ bool operator<=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
||||||
!gsl::details::is_basic_string_span<T>::value>>
|
!gsl::details::is_basic_string_span<T>::value>>
|
||||||
@ -569,7 +569,7 @@ bool operator<=(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
// so the cases below are already covered by the previous operators
|
// so the cases below are already covered by the previous operators
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -582,7 +582,7 @@ bool operator<=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -596,7 +596,7 @@ bool operator<=(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// operator>
|
// operator>
|
||||||
template <typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
template <typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<std::is_convertible<
|
typename = std::enable_if_t<std::is_convertible<
|
||||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||||
bool operator>(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
bool operator>(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
||||||
@ -605,7 +605,7 @@ bool operator>(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
||||||
!gsl::details::is_basic_string_span<T>::value>>
|
!gsl::details::is_basic_string_span<T>::value>>
|
||||||
@ -620,7 +620,7 @@ bool operator>(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
// so the cases below are already covered by the previous operators
|
// so the cases below are already covered by the previous operators
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -633,7 +633,7 @@ bool operator>(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -647,7 +647,7 @@ bool operator>(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// operator >=
|
// operator >=
|
||||||
template <typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
template <typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<std::is_convertible<
|
typename = std::enable_if_t<std::is_convertible<
|
||||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||||
bool operator>=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
bool operator>=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
||||||
@ -656,7 +656,7 @@ bool operator>=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value &&
|
||||||
!gsl::details::is_basic_string_span<T>::value>>
|
!gsl::details::is_basic_string_span<T>::value>>
|
||||||
@ -671,7 +671,7 @@ bool operator>=(const T& one, gsl::basic_string_span<CharT, Extent> other)
|
|||||||
// so the cases below are already covered by the previous operators
|
// so the cases below are already covered by the previous operators
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
@ -684,7 +684,7 @@ bool operator>=(gsl::basic_string_span<CharT, Extent> one, const T& other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename CharT, std::size_t Extent = gsl::dynamic_extent, typename T,
|
typename CharT, std::size_t Extent = dynamic_extent, typename T,
|
||||||
typename DataType = typename T::value_type,
|
typename DataType = typename T::value_type,
|
||||||
typename = std::enable_if_t<
|
typename = std::enable_if_t<
|
||||||
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
!gsl::details::is_span<T>::value && !gsl::details::is_basic_string_span<T>::value &&
|
||||||
|
Loading…
Reference in New Issue
Block a user