summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buffer.cpp2
-rw-r--r--buffer.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/buffer.cpp b/buffer.cpp
index b1029a6..342373a 100644
--- a/buffer.cpp
+++ b/buffer.cpp
@@ -115,7 +115,7 @@ u_int8_t* Buffer::getBuf()
return buf_;
}
-u_int8_t& Buffer::operator[](u_int32_t index)
+u_int8_t Buffer::operator[](u_int32_t index)
{
if(index >= length_)
throw std::out_of_range("buffer::operator[]");
diff --git a/buffer.h b/buffer.h
index aa279d9..6219939 100644
--- a/buffer.h
+++ b/buffer.h
@@ -46,7 +46,7 @@ public:
u_int32_t resize(u_int32_t new_length);
u_int32_t getLength() const;
u_int8_t* getBuf();
- u_int8_t& operator[](u_int32_t index);
+ u_int8_t operator[](u_int32_t index);
u_int8_t const& operator[](u_int32_t index) const;
protected: