diff options
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r-- | src/corelib/text/qstring.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 780b3090c1..5936f76ed4 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -941,6 +941,11 @@ public: void shrink_to_fit() { squeeze(); } iterator erase(const_iterator first, const_iterator last); inline iterator erase(const_iterator it) { return erase(it, it + 1); } + static constexpr qsizetype max_size() noexcept + { + // -1 to deal with the NUL terminator + return Data::max_size() - 1; + } static inline QString fromStdString(const std::string &s); inline std::string toStdString() const; |