aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/ConstBuffer.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/ConstBuffer.hxx')
-rw-r--r--src/util/ConstBuffer.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx
index 7f1fa5aa6..6754cb065 100644
--- a/src/util/ConstBuffer.hxx
+++ b/src/util/ConstBuffer.hxx
@@ -143,6 +143,17 @@ struct ConstBuffer {
constexpr const_iterator cend() const {
return data + size;
}
+
+#ifdef NDEBUG
+ constexpr
+#endif
+ const T &operator[](size_type i) const {
+#ifndef NDEBUG
+ assert(i < size);
+#endif
+
+ return data[i];
+ }
};
#endif