QSpan: make it a bit more QDoc-friendly
Hide the base class; the documentation isn't supposed to show this implementation detail. Don't use auto return types for the begin/end family of member functions; QDoc doesn't resolve them, but just shows auto, which, without seeing the implementation, is pretty useless. Change-Id: If75cc1e7de9c5c1490cb37241739449df4e5d0c2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 3814174faefef4f0a00a97d980d97312d73d132b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
283ec1055b
commit
89e8253de5
@ -252,7 +252,10 @@ public:
|
||||
} // namespace QSpanPrivate
|
||||
|
||||
template <typename T, std::size_t E>
|
||||
class QSpan : private QSpanPrivate::QSpanBase<T, E>
|
||||
class QSpan
|
||||
#ifndef Q_QDOC
|
||||
: private QSpanPrivate::QSpanBase<T, E>
|
||||
#endif
|
||||
{
|
||||
using Base = QSpanPrivate::QSpanBase<T, E>;
|
||||
Q_ALWAYS_INLINE constexpr void verify([[maybe_unused]] qsizetype pos = 0,
|
||||
@ -298,14 +301,14 @@ public:
|
||||
[[nodiscard]] constexpr pointer data() const noexcept { return this->m_data; }
|
||||
|
||||
// [span.iterators]
|
||||
[[nodiscard]] constexpr auto begin() const noexcept { return data(); }
|
||||
[[nodiscard]] constexpr auto end() const noexcept { return data() + size(); }
|
||||
[[nodiscard]] constexpr auto cbegin() const noexcept { return const_iterator{begin()}; }
|
||||
[[nodiscard]] constexpr auto cend() const noexcept { return const_iterator{end()}; }
|
||||
[[nodiscard]] constexpr auto rbegin() const noexcept { return reverse_iterator{end()}; }
|
||||
[[nodiscard]] constexpr auto rend() const noexcept { return reverse_iterator{begin()}; }
|
||||
[[nodiscard]] constexpr auto crbegin() const noexcept { return const_reverse_iterator{end()}; }
|
||||
[[nodiscard]] constexpr auto crend() const noexcept { return const_reverse_iterator{begin()}; }
|
||||
[[nodiscard]] constexpr iterator begin() const noexcept { return data(); }
|
||||
[[nodiscard]] constexpr iterator end() const noexcept { return data() + size(); }
|
||||
[[nodiscard]] constexpr const_iterator cbegin() const noexcept { return begin(); }
|
||||
[[nodiscard]] constexpr const_iterator cend() const noexcept { return end(); }
|
||||
[[nodiscard]] constexpr reverse_iterator rbegin() const noexcept { return reverse_iterator{end()}; }
|
||||
[[nodiscard]] constexpr reverse_iterator rend() const noexcept { return reverse_iterator{begin()}; }
|
||||
[[nodiscard]] constexpr const_reverse_iterator crbegin() const noexcept { return rbegin(); }
|
||||
[[nodiscard]] constexpr const_reverse_iterator crend() const noexcept { return rend(); }
|
||||
|
||||
// [span.sub]
|
||||
template <std::size_t Count>
|
||||
|
Loading…
x
Reference in New Issue
Block a user