Prevent assignment to wxString::const_iterator from compiling

Make const_reference const and dereference const_iterator into a
const_reference to ensure that the code trying to assign to a (dereferenced)
const_iterator doesn't compile.

Closes https://github.com/wxWidgets/wxWidgets/pull/316
This commit is contained in:
Lauri Nurmi 2016-08-27 18:51:37 +03:00 committed by VZ
parent 23527a5f81
commit 84969ba00d

View File

@ -702,7 +702,7 @@ public:
typedef const wxChar* const_pointer;
typedef size_t size_type;
typedef wxUniChar const_reference;
typedef const wxUniChar const_reference;
#if wxUSE_STD_STRING
#if wxUSE_UNICODE_UTF8
@ -951,7 +951,7 @@ public:
const_iterator(const const_iterator& i) : m_cur(i.m_cur) {}
const_iterator(const iterator& i) : m_cur(i.m_cur) {}
reference operator*() const
const_reference operator*() const
{ return wxStringOperations::DecodeChar(m_cur); }
const_iterator operator+(ptrdiff_t n) const