mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
deprecating span::at and span::operator()
This commit is contained in:
parent
7e99e76c97
commit
5e0d76a1a7
@ -510,8 +510,12 @@ public:
|
|||||||
return data()[idx];
|
return data()[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// at and operator() are deprecated to align to the public member functions of std::span
|
||||||
|
[[deprecated("Use operator[]")]]
|
||||||
constexpr reference at(index_type idx) const { return this->operator[](idx); }
|
constexpr reference at(index_type idx) const { return this->operator[](idx); }
|
||||||
|
[[deprecated("Use operator[]")]]
|
||||||
constexpr reference operator()(index_type idx) const { return this->operator[](idx); }
|
constexpr reference operator()(index_type idx) const { return this->operator[](idx); }
|
||||||
|
|
||||||
constexpr pointer data() const noexcept { return storage_.data(); }
|
constexpr pointer data() const noexcept { return storage_.data(); }
|
||||||
|
|
||||||
// [span.iter], span iterator support
|
// [span.iter], span iterator support
|
||||||
|
@ -18,7 +18,12 @@
|
|||||||
// blanket turn off warnings from CppCoreCheck from catch
|
// blanket turn off warnings from CppCoreCheck from catch
|
||||||
// so people aren't annoyed by them when running the tool.
|
// so people aren't annoyed by them when running the tool.
|
||||||
#pragma warning(disable : 26440 26426 26497) // from catch
|
#pragma warning(disable : 26440 26426 26497) // from catch
|
||||||
|
#pragma warning(disable : 4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __clang__ || __GNUC__
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
|
#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
|
||||||
@ -1562,3 +1567,6 @@ TEST_CASE("default_constructible")
|
|||||||
CHECK((!std::is_default_constructible<span<int, 42>>::value));
|
CHECK((!std::is_default_constructible<span<int, 42>>::value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __clang__ || __GNUC__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user