diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-10-29 17:53:08 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-10-29 18:28:00 +0100 |
commit | 59644dc9df8e73690339a7ff30500829906eb02b (patch) | |
tree | 23750dc06f63ba82bd5240a913e11fe8ca85d354 /src/corelib | |
parent | f604fe6d1d91b32cb73cb3b5dda0a7e07472b03f (diff) |
Doc: Fix documentation issues for QStringTokenizer
Add documentation-specific variants of lvalue/rvalue-this
overloads that QDoc manages to parse as separate entities.
Document begin() and cbegin() iterator getters in one go.
Task-number: QTBUG-86295
Change-Id: I2768dc6525bbf067e1597aa12e2e727f6d9fc35a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qstringtokenizer.cpp | 21 | ||||
-rw-r--r-- | src/corelib/text/qstringtokenizer.h | 10 |
2 files changed, 10 insertions, 21 deletions
diff --git a/src/corelib/text/qstringtokenizer.cpp b/src/corelib/text/qstringtokenizer.cpp index f0efcc1371..44999425ae 100644 --- a/src/corelib/text/qstringtokenizer.cpp +++ b/src/corelib/text/qstringtokenizer.cpp @@ -245,7 +245,8 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template <typename Haystack, typename Needle> QStringTokenizer<Haystack, Needle>::const_iterator QStringTokenizer<Haystack, Needle>::begin() const + \fn template <typename Haystack, typename Needle> QStringTokenizer<Haystack, Needle>::iterator QStringTokenizer<Haystack, Needle>::begin() const + \fn template <typename Haystack, typename Needle> QStringTokenizer<Haystack, Needle>::iterator QStringTokenizer<Haystack, Needle>::cbegin() const Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first token in the list. @@ -254,14 +255,6 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template <typename Haystack, typename Needle> QStringTokenizer<Haystack, Needle>::const_iterator QStringTokenizer<Haystack, Needle>::cbegin() const - - Same as begin(). - - \sa cend(), begin() -*/ - -/*! \fn template <typename Haystack, typename Needle> QStringTokenizer<Haystack, Needle>::sentinel QStringTokenizer<Haystack, Needle>::end() const Returns a const \l{STL-style iterators}{STL-style sentinel} @@ -279,15 +272,15 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template <typename Haystack, typename Needle> template<typename Container> Container QStringTokenizer<Haystack, Needle>::toContainer(Container &&c) const & + \fn template <typename Haystack, typename Needle> template<typename LContainer> LContainer QStringTokenizer<Haystack, Needle>::toContainer(LContainer &&c) const & Converts the lazy sequence into a (typically) random-access container of - type \c Container. + type \c LContainer. This function is only available if \c Container has a \c value_type matching this tokenizer's value_type. - If you pass in a named container (an lvalue)for \a c, then that container + If you pass in a named container (an lvalue) for \a c, then that container is filled, and a reference to it is returned. If you pass in a temporary container (an rvalue, incl. the default argument), then that container is filled, and returned by value. @@ -310,11 +303,11 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template <typename Haystack, typename Needle> template<typename Container> Container QStringTokenizer<Haystack, Needle>::toContainer(Container &&c) const && + \fn template <typename Haystack, typename Needle> template<typename RContainer> RContainer QStringTokenizer<Haystack, Needle>::toContainer(RContainer &&c) const && \overload Converts the lazy sequence into a (typically) random-access container of - type \c Container. + type \c RContainer. In addition to the constraints on the lvalue-this overload, this rvalue-this overload is only available when this QStringTokenizer diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index d6944cbcae..f1da701af2 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -329,29 +329,25 @@ public: {} #ifdef Q_QDOC - template<typename Container> + template<typename LContainer> LContainer toContainer(LContainer &&c = {}) const & {} + template<typename RContainer> RContainer toContainer(RContainer &&c = {}) const && {} #else template<typename Container = QList<value_type>, if_compatible_container<Container> = true> -#endif Container toContainer(Container &&c = {}) const & { for (auto e : *this) c.emplace_back(e); return std::move(c); } - -#ifdef Q_QDOC - template<typename Container> -#else template<typename Container = QList<value_type>, if_compatible_container<Container> = true, if_haystack_not_pinned<Container> = true> -#endif Container toContainer(Container &&c = {}) const && { for (auto e : *this) c.emplace_back(e); return std::move(c); } +#endif }; namespace QtPrivate { |