deprecating span::at and span::operator()

This commit is contained in:
Jordan Maples [MSFT] 2019-11-19 14:31:21 -08:00
parent 0fefba89da
commit cfd82aef4e
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -17,8 +17,11 @@
#ifdef _MSC_VER #ifdef _MSC_VER
// 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 4189) // from catch #pragma warning(disable : 26440 26426 26497 4189 4996)
#if __clang__ || __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
#if __clang__ || __GNUC__ #if __clang__ || __GNUC__