Q{Any,Utf8,}StringView: fix docs of generic Container ctor

For QAnyStringView, the docs were missing completely.

For QUtf8StringView and QStringView, they weren't updated following
the rewrite of the std::basic_string ctors into generic Container
ones.

Amends 9e1dc1e8a9 and
2c9529e158.

Pick-to: 6.5 6.2
Task-number: QTBUG-112746
Change-Id: I6eef2294db01e35f1a085df7fc76c25c6003530d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2023-04-25 23:10:23 +02:00
parent 263e0b899f
commit fd6ecd8561
3 changed files with 29 additions and 12 deletions

View File

@ -214,6 +214,23 @@
The string view will be null if and only if \c{str.isNull()}. The string view will be null if and only if \c{str.isNull()}.
*/ */
/*!
\fn template <typename Container, if_compatible_container<Container>> QAnyStringView::QAnyStringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{std::size(str)}.
\c{std::data(str)} must remain valid for the lifetime of this string view object.
This constructor only participates in overload resolution if \c Container is a
container with a compatible character type as \c{value_type}.
The string view will be empty if and only if \c{std::size(str) == 0}. It is unspecified
whether this constructor can result in a null string view (\c{std::data(str)} would
have to return \nullptr for this).
\sa isNull(), isEmpty()
*/
/*! /*!
\fn template <typename Char, size_t Size> static QAnyStringView fromArray(const Char (&string)[Size]) noexcept \fn template <typename Char, size_t Size> static QAnyStringView fromArray(const Char (&string)[Size]) noexcept

View File

@ -264,17 +264,17 @@ QT_BEGIN_NAMESPACE
/*! /*!
\fn template <typename Container, if_compatible_container<Container>> QStringView::QStringView(const Container &str) \fn template <typename Container, if_compatible_container<Container>> QStringView::QStringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{str.size()}. Constructs a string view on \a str. The length is taken from \c{std::size(str)}.
\c{str.data()} must remain valid for the lifetime of this string view object. \c{std::data(str)} must remain valid for the lifetime of this string view object.
This constructor only participates in overload resolution if \c StdBasicString is an This constructor only participates in overload resolution if \c Container is a
instantiation of \c std::basic_string with a compatible character type. The container with a compatible character type as \c{value_type}. The
compatible character types are: \c QChar, \c ushort, \c char16_t and compatible character types are: \c QChar, \c ushort, \c char16_t and
(on platforms, such as Windows, where it is a 16-bit type) \c wchar_t. (on platforms, such as Windows, where it is a 16-bit type) \c wchar_t.
The string view will be empty if and only if \c{str.empty()}. It is unspecified The string view will be empty if and only if \c{std::size(str) == 0}. It is unspecified
whether this constructor can result in a null string view (\c{str.data()} would whether this constructor can result in a null string view (\c{std::data(str)} would
have to return \nullptr for this). have to return \nullptr for this).
\sa isNull(), isEmpty() \sa isNull(), isEmpty()

View File

@ -289,17 +289,17 @@
/*! /*!
\fn template <typename Container, if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str) \fn template <typename Container, if_compatible_container<Container>> QUtf8StringView::QUtf8StringView(const Container &str)
Constructs a string view on \a str. The length is taken from \c{str.size()}. Constructs a string view on \a str. The length is taken from \c{std::size(str)}.
\c{str.data()} must remain valid for the lifetime of this string view object. \c{std::data(str)} must remain valid for the lifetime of this string view object.
This constructor only participates in overload resolution if \c Container is an This constructor only participates in overload resolution if \c Container is a
instantiation of \c std::basic_string with a compatible character type. The container with a compatible character type as \c{value_type}. The
compatible character types are: \c char8_t, \c char, \c{signed char} and compatible character types are: \c char8_t, \c char, \c{signed char} and
\c{unsigned char}. \c{unsigned char}.
The string view will be empty if and only if \c{str.empty()}. It is unspecified The string view will be empty if and only if \c{std::size(str) == 0}. It is unspecified
whether this constructor can result in a null string view (\c{str.data()} would whether this constructor can result in a null string view (\c{std::data(str)} would
have to return \nullptr for this). have to return \nullptr for this).
\sa isNull(), isEmpty() \sa isNull(), isEmpty()