mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 06:24:12 +00:00
More robust <span> check (#8631)
This commit is contained in:
@@ -47,7 +47,9 @@
|
|||||||
// See: https://en.cppreference.com/w/cpp/utility/feature_test
|
// See: https://en.cppreference.com/w/cpp/utility/feature_test
|
||||||
#if defined(__cplusplus) && __cplusplus >= 202002L \
|
#if defined(__cplusplus) && __cplusplus >= 202002L \
|
||||||
|| (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
|| (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||||
#define FLATBUFFERS_USE_STD_SPAN 1
|
#if __has_include(<span>)
|
||||||
|
#define FLATBUFFERS_USE_STD_SPAN 1
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif // FLATBUFFERS_USE_STD_SPAN
|
#endif // FLATBUFFERS_USE_STD_SPAN
|
||||||
|
|
||||||
@@ -321,7 +323,7 @@ namespace internal {
|
|||||||
SpanIterator(pointer ptr) : ptr_(ptr) {}
|
SpanIterator(pointer ptr) : ptr_(ptr) {}
|
||||||
reference operator*() const { return *ptr_; }
|
reference operator*() const { return *ptr_; }
|
||||||
pointer operator->() { return ptr_; }
|
pointer operator->() { return ptr_; }
|
||||||
SpanIterator& operator++() { ptr_++; return *this; }
|
SpanIterator& operator++() { ptr_++; return *this; }
|
||||||
SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; }
|
SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; }
|
||||||
|
|
||||||
friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; }
|
friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; }
|
||||||
|
|||||||
Reference in New Issue
Block a user