summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-08-29 12:09:32 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-08-30 10:13:07 -0700
commit6306ebe749e083126a39b9dd13d7060aa7bdacc2 (patch)
treef471e1bec3106af925c7c74a276d5c354f985097 /src/corelib/text/qstring.cpp
parentf02402044e552f2940d4677039f3d02c41eb27ee (diff)
Containers: add a static constexpr maxSize()
max_size() will be made non-static to strictly follow the C++ Standard Library concept, but it makes no sense for the Qt containers to have allocations limited per instance, as they are not allocator-aware. This commit adds a Qt-style camelCase() function to the STL-style snake_case() with the semantics we want. Pick-to: 6.8 Task-number: QTBUG-128450 Change-Id: I2e4aa228c71c821c01bafc0f37956d29fe652ef1 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index c690be9873b..f596619dfd7 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -6413,10 +6413,9 @@ QString& QString::fill(QChar ch, qsizetype size)
/*!
\fn qsizetype QString::max_size()
+ \fn qsizetype QString::maxSize()
\since 6.8
- This function is provided for STL compatibility.
-
It returns the maximum number of elements that the string can
theoretically hold. In practice, the number can be much smaller,
limited by the amount of memory available to the system.