From c22d98a8ec62c4211dc085e9d3a3e2153e40a9c4 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 22 Jan 2001 05:03:48 +0000 Subject: [PATCH] Quick fix to my_iterator, which wasn't returning a reference type from operator* [SVN r8705] --- iterator_traits_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iterator_traits_test.cpp b/iterator_traits_test.cpp index 6eb9e65..5eb17ba 100644 --- a/iterator_traits_test.cpp +++ b/iterator_traits_test.cpp @@ -7,6 +7,8 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 21 Jan 2001 Quick fix to my_iterator, which wasn't returning a +// reference type from operator* (David Abrahams) // 19 Jan 2001 Initial version with iterator operators (David Abrahams) #include @@ -28,7 +30,7 @@ struct my_iterator { return this->m_p == rhs.m_p; } my_iterator& operator++() { ++this->m_p; return *this; } - const char operator*() { return *m_p; } + const char& operator*() { return *m_p; } private: const char* m_p; };