diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-01-27 08:27:23 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-01-27 08:27:23 +0000 |
| commit | f8106690b1ea1f307671bb347cc86869c1c88d2c (patch) | |
| tree | 34fb3d97b0bc6b6d77a2aaa85f1b0994956d866f /src/buffer.hh | |
| parent | 04119d6207c871962dd17106b034ce229df580b9 (diff) | |
Make BufferIterator::operator* return a const ref to be more compatible
Diffstat (limited to 'src/buffer.hh')
| -rw-r--r-- | src/buffer.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffer.hh b/src/buffer.hh index 60820487..c8870509 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -64,8 +64,8 @@ public: bool operator> (const BufferIterator& iterator) const; bool operator>= (const BufferIterator& iterator) const; - char operator* () const; - char operator[](size_t n) const; + const char& operator* () const; + const char& operator[](size_t n) const; size_t operator- (const BufferIterator& iterator) const; BufferIterator operator+ (ByteCount size) const; @@ -133,7 +133,7 @@ public: String string(ByteCoord begin, ByteCoord end) const; - char byte_at(ByteCoord c) const; + const char& byte_at(ByteCoord c) const; ByteCount distance(ByteCoord begin, ByteCoord end) const; ByteCoord advance(ByteCoord coord, ByteCount count) const; ByteCoord next(ByteCoord coord) const; |
