aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/WritableBuffer.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-04-24 09:47:59 +0200
committerMax Kellermann <max@duempel.org>2014-04-24 09:47:59 +0200
commit3b8a9dd6ecc8f8bb0674e215fa59dfc8d3ad0c2a (patch)
tree027afe23923250d2fc449dc44037c85a7602f167 /src/util/WritableBuffer.hxx
parentcfbee59152869048804df6105fa7fcbd897021f5 (diff)
downloadmpd-3b8a9dd6ecc8f8bb0674e215fa59dfc8d3ad0c2a.tar.gz
mpd-3b8a9dd6ecc8f8bb0674e215fa59dfc8d3ad0c2a.tar.xz
mpd-3b8a9dd6ecc8f8bb0674e215fa59dfc8d3ad0c2a.zip
util/{Const,Writable}Buffer: add typedef reference_type
Diffstat (limited to '')
-rw-r--r--src/util/WritableBuffer.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/WritableBuffer.hxx b/src/util/WritableBuffer.hxx
index d13f80867..1fe1b254f 100644
--- a/src/util/WritableBuffer.hxx
+++ b/src/util/WritableBuffer.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Max Kellermann <max@duempel.org>
+ * Copyright (C) 2013-2014 Max Kellermann <max@duempel.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -80,6 +80,8 @@ struct WritableBuffer<void> {
template<typename T>
struct WritableBuffer {
typedef size_t size_type;
+ typedef T &reference_type;
+ typedef const T &const_reference_type;
typedef T *pointer_type;
typedef const T *const_pointer_type;
typedef pointer_type iterator;
@@ -149,7 +151,7 @@ struct WritableBuffer {
#ifdef NDEBUG
constexpr
#endif
- T &operator[](size_type i) const {
+ reference_type operator[](size_type i) const {
#ifndef NDEBUG
assert(i < size);
#endif