Add copy ctor for wxUniCharRef

It just does the default, but C++11 deprecates having copy assignment operator
without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings.
This commit is contained in:
Paul Cornett
2019-10-14 09:08:13 -07:00
parent a3598ba33f
commit 2ece977ed7

View File

@@ -267,6 +267,12 @@ public:
wxUniCharRef& operator=(const wxUniCharRef& c)
{ if (&c != this) *this = c.UniChar(); return *this; }
#if wxUSE_UNICODE_UTF8
wxUniCharRef(const wxUniCharRef& that) : m_str(that.m_str), m_pos(that.m_pos) { }
#else
wxUniCharRef(const wxUniCharRef& that) : m_pos(that.m_pos) { }
#endif
#define wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL(type) \
wxUniCharRef& operator=(type c) { return *this = wxUniChar(c); }
wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL)