added operator-(const wxChar *, const wxCStrData&) to allow compilation of the code doing "p - s.c_str()" where p is a pointer into the string s
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2347,6 +2347,22 @@ inline wxUniChar wxCStrData::operator[](size_t n) const
|
||||
return m_str->at(m_offset + n);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// more wxCStrData operators
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we need to define those to allow "size_t pos = p - s.c_str()" where p is
|
||||
// some pointer into the string
|
||||
inline size_t operator-(const char *p, const wxCStrData& cs)
|
||||
{
|
||||
return p - cs.AsChar();
|
||||
}
|
||||
|
||||
inline size_t operator-(const wchar_t *p, const wxCStrData& cs)
|
||||
{
|
||||
return p - cs.AsWChar();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// implementation of wx[W]CharBuffer inline methods using wxCStrData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user