diff options
Diffstat (limited to '')
-rw-r--r-- | src/util/WritableBuffer.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/WritableBuffer.hxx b/src/util/WritableBuffer.hxx index 64e6d0c62..d13f80867 100644 --- a/src/util/WritableBuffer.hxx +++ b/src/util/WritableBuffer.hxx @@ -145,6 +145,17 @@ struct WritableBuffer { constexpr const_iterator cend() const { return data + size; } + +#ifdef NDEBUG + constexpr +#endif + T &operator[](size_type i) const { +#ifndef NDEBUG + assert(i < size); +#endif + + return data[i]; + } }; #endif |