[Libreoffice-commits] core.git: include/o3tl
Stephan Bergmann
sbergman at redhat.com
Wed Apr 29 02:15:36 PDT 2015
include/o3tl/enumarray.hxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit d01810b745fad6afce8be838657471c297da6d53
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Apr 29 11:15:11 2015 +0200
enumarray_iterator should not have a deleted copy assignment op
Change-Id: I1e5f8dcfe0801eca10622eefab43b674b6b3e956
diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx
index 355e674..648ea65 100644
--- a/include/o3tl/enumarray.hxx
+++ b/include/o3tl/enumarray.hxx
@@ -79,7 +79,7 @@ public:
template<typename EA>
class enumarray_iterator {
- EA &m_buf;
+ EA *m_buf;
size_t m_pos;
public:
typedef enumarray_iterator<EA> self_type;
@@ -91,12 +91,12 @@ public:
typedef typename EA::value_type& reference;
enumarray_iterator(EA& b, size_t start_pos)
- : m_buf(b), m_pos(start_pos) {}
- value_type &operator*() { return m_buf[static_cast<key_type>(m_pos)]; }
+ : m_buf(&b), m_pos(start_pos) {}
+ value_type &operator*() { return (*m_buf)[static_cast<key_type>(m_pos)]; }
value_type *operator->() { return &(operator*()); }
self_type &operator++() { ++m_pos; return *this; }
- bool operator!=(const self_type& other) { return &m_buf != &other.m_buf || m_pos != other.m_pos; }
- bool operator==(const self_type& other) { return &m_buf == &other.m_buf && m_pos == other.m_pos; }
+ bool operator!=(const self_type& other) { return m_buf != other.m_buf || m_pos != other.m_pos; }
+ bool operator==(const self_type& other) { return m_buf == other.m_buf && m_pos == other.m_pos; }
};
}; // namespace o3tl
More information about the Libreoffice-commits
mailing list