mirror of
https://github.com/google/flatbuffers.git
synced 2025-04-08 09:12:14 +08:00
[jumbo] Add begin()/end() to DetachedBuffer. (#8370)
This allows this type to meet the requirements of e.g. std::ranges::range, which is necessary for it to work with the std::span range constructor, or the "non-legacy" constructor for Chromium's base::span. Bug: none Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
parent
7833affd7e
commit
42879f6ea6
@ -80,6 +80,11 @@ class DetachedBuffer {
|
|||||||
|
|
||||||
size_t size() const { return size_; }
|
size_t size() const { return size_; }
|
||||||
|
|
||||||
|
uint8_t *begin() { return data(); }
|
||||||
|
const uint8_t *begin() const { return data(); }
|
||||||
|
uint8_t *end() { return data() + size(); }
|
||||||
|
const uint8_t *end() const { return data() + size(); }
|
||||||
|
|
||||||
// These may change access mode, leave these at end of public section
|
// These may change access mode, leave these at end of public section
|
||||||
FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other));
|
FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other));
|
||||||
FLATBUFFERS_DELETE_FUNC(
|
FLATBUFFERS_DELETE_FUNC(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user