diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-04 13:37:16 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-08 10:30:02 +0100 |
commit | 37e054993b763c022ab5f4a4d34e92ddffba34f5 (patch) | |
tree | 246da35fafa38d92f031446a21a41ae6df435dae /src/corelib/text | |
parent | 4802f96d4d5b2bea62073295edde1eaa348033db (diff) |
Get rid of the operator[](uint) overloads
Those make no sense and where probably only there to workaround
bugs in some old compilers.
Change-Id: I5b196cc5306ac1c6307257b70179278d82d383c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 10 | ||||
-rw-r--r-- | src/corelib/text/qbytearray.h | 6 | ||||
-rw-r--r-- | src/corelib/text/qstring.cpp | 13 | ||||
-rw-r--r-- | src/corelib/text/qstring.h | 6 |
4 files changed, 0 insertions, 35 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 7562227d7d..841c02f1e4 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -1458,16 +1458,6 @@ QByteArray &QByteArray::operator=(const char *str) Same as at(\a i). */ -/*! \fn QByteRef QByteArray::operator[](uint i) - - \overload -*/ - -/*! \fn char QByteArray::operator[](uint i) const - - \overload -*/ - /*! \fn char QByteArray::front() const \since 5.10 diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index e9e4eecd26..67a7e5da3d 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -208,9 +208,7 @@ public: inline char at(int i) const; inline char operator[](int i) const; - inline char operator[](uint i) const; Q_REQUIRED_RESULT inline QByteRef operator[](int i); - Q_REQUIRED_RESULT inline QByteRef operator[](uint i); Q_REQUIRED_RESULT char front() const { return at(0); } Q_REQUIRED_RESULT inline QByteRef front(); Q_REQUIRED_RESULT char back() const { return at(size() - 1); } @@ -477,8 +475,6 @@ inline char QByteArray::at(int i) const { Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; } inline char QByteArray::operator[](int i) const { Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; } -inline char QByteArray::operator[](uint i) const -{ Q_ASSERT(i < uint(size())); return d->data()[i]; } inline bool QByteArray::isEmpty() const { return d->size == 0; } @@ -599,8 +595,6 @@ public: inline QByteRef QByteArray::operator[](int i) { Q_ASSERT(i >= 0); detach(); return QByteRef(*this, i); } -inline QByteRef QByteArray::operator[](uint i) -{ detach(); return QByteRef(*this, i); } inline QByteRef QByteArray::front() { return operator[](0); } inline QByteRef QByteArray::back() { return operator[](size() - 1); } inline QByteArray::iterator QByteArray::begin() diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 8ae365338d..3b6c3fb70f 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -5742,19 +5742,6 @@ QString QString::trimmed_helper(QString &str) \overload operator[]() */ -/*! \fn QCharRef QString::operator[](uint position) - -\overload operator[]() - -Returns the character at the specified \a position in the string as a -modifiable reference. -*/ - -/*! \fn const QChar QString::operator[](uint position) const - Equivalent to \c at(position). -\overload operator[]() -*/ - /*! \fn QChar QString::front() const \since 5.10 diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index bcc1200125..74528b47c5 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -291,8 +291,6 @@ public: inline const QChar at(int i) const; const QChar operator[](int i) const; Q_REQUIRED_RESULT QCharRef operator[](int i); - const QChar operator[](uint i) const; - Q_REQUIRED_RESULT QCharRef operator[](uint i); Q_REQUIRED_RESULT inline QChar front() const { return at(0); } Q_REQUIRED_RESULT inline QCharRef front(); @@ -1028,8 +1026,6 @@ inline const QChar QString::at(int i) const { Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); } inline const QChar QString::operator[](int i) const { Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); } -inline const QChar QString::operator[](uint i) const -{ Q_ASSERT(i < uint(size())); return QChar(d->data()[i]); } inline bool QString::isEmpty() const { return d->size == 0; } inline const QChar *QString::unicode() const @@ -1285,8 +1281,6 @@ inline QString &QString::setUtf16(const ushort *autf16, int asize) { return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); } inline QCharRef QString::operator[](int i) { Q_ASSERT(i >= 0); detach(); return QCharRef(*this, i); } -inline QCharRef QString::operator[](uint i) -{ detach(); return QCharRef(*this, i); } inline QCharRef QString::front() { return operator[](0); } inline QCharRef QString::back() { return operator[](size() - 1); } inline QString::iterator QString::begin() |