mirror of
https://github.com/microsoft/GSL.git
synced 2025-05-12 17:05:20 -04:00
Fix some corechecker warnings (#470)
* Improve const correctness in string_span * Improve const correctness in bounds_tests.cpp and byte_tests.cpp * Improve const correctness in span_tests.cpp * Improve const correctness in utils_tests.cpp * Use gsl::owner for dynamically allocated memory in string_span_tests.cpp * Improve const correctness in string_span_tests.cpp * Improve const correctness for strided_span_tests.cpp
This commit is contained in:
@ -577,7 +577,7 @@ template <class CharT, std::ptrdiff_t Extent, class T,
|
||||
std::is_convertible<T, gsl::basic_string_span<std::add_const_t<CharT>>>::value>>
|
||||
bool operator==(const gsl::basic_string_span<CharT, Extent>& one, const T& other) GSL_NOEXCEPT
|
||||
{
|
||||
gsl::basic_string_span<std::add_const_t<CharT>> tmp(other);
|
||||
const gsl::basic_string_span<std::add_const_t<CharT>> tmp(other);
|
||||
#ifdef GSL_MSVC_NO_CPP14_STD_EQUAL
|
||||
return (one.size() == tmp.size()) && std::equal(one.begin(), one.end(), tmp.begin());
|
||||
#else
|
||||
@ -624,7 +624,7 @@ template <typename CharT, std::ptrdiff_t Extent = gsl::dynamic_extent, typename
|
||||
T, gsl::basic_string_span<std::add_const_t<CharT>, Extent>>::value>>
|
||||
bool operator<(gsl::basic_string_span<CharT, Extent> one, const T& other) GSL_NOEXCEPT
|
||||
{
|
||||
gsl::basic_string_span<std::add_const_t<CharT>, Extent> tmp(other);
|
||||
const gsl::basic_string_span<std::add_const_t<CharT>, Extent> tmp(other);
|
||||
return std::lexicographical_compare(one.begin(), one.end(), tmp.begin(), tmp.end());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user