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>
bb10
Topi Reinio 2020-10-29 17:53:08 +01:00
parent f604fe6d1d
commit 59644dc9df
2 changed files with 10 additions and 21 deletions

View File

@ -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.
@ -253,14 +254,6 @@ QT_BEGIN_NAMESPACE
\sa end(), cbegin()
*/
/*!
\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
@ -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

View File

@ -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 {