diff options
Diffstat (limited to 'src/corelib/tools/qspan.qdoc')
-rw-r--r-- | src/corelib/tools/qspan.qdoc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/corelib/tools/qspan.qdoc b/src/corelib/tools/qspan.qdoc index 472f122877..9b55b09bf7 100644 --- a/src/corelib/tools/qspan.qdoc +++ b/src/corelib/tools/qspan.qdoc @@ -556,7 +556,6 @@ \sa subspan(QSpan<T,E>::size_type), subspan(), first(), last() */ -#if 0 // needs fix for QTBUG-118080 integrated into qt5.git /*! \fn template <typename T, size_t E> template <std::size_t Offset, std::size_t Count> auto QSpan<T, E>::subspan() const \keyword subspan-t2 @@ -573,7 +572,6 @@ \sa subspan(QSpan<T,E>::size_type, QSpan<T,E>::size_type), subspan(), first(), last() */ -#endif // // runtime subspans: @@ -649,3 +647,37 @@ \sa subspan(), first(QSpan<T,E>::size_type), last(QSpan<T,E>::size_type) */ +/*! + \fn template <typename T, size_t E> auto QSpan<T, E>::as_bytes(QSpan s) + \since 6.8 + + Returns \a s as a \c{QSpan<const std::byte, E'>} whose size() is equal to + \c{s.size_bytes()}. + + If \c{E} is \c{std::dynamic_extent} then so is \c{E'}. + Otherwise, \c{E' = E * sizeof(T)}. + + \note \c{q20::dynamic_extent} is a C++17 backport of C++20's + \l{https://en.cppreference.com/w/cpp/container/span/dynamic_extent}{\c{std::dynamic_extent}}. + + \sa as_writable_bytes(), size_bytes() +*/ + +/*! + \fn template <typename T, size_t E> auto QSpan<T, E>::as_writable_bytes(QSpan s) + \since 6.8 + + Returns \a s as a \c{QSpan<std::byte, E'>} whose size() is equal to + \c{s.size_bytes()}. + + If \c{E} is \c{std::dynamic_extent} then so is \c{E'}. + Otherwise, \c{E' = E * sizeof(T)}. + + \note This function participates in overload resolution only if + \c{!std::is_const_v<T>}. + + \note \c{q20::dynamic_extent} is a C++17 backport of C++20's + \l{https://en.cppreference.com/w/cpp/container/span/dynamic_extent}{\c{std::dynamic_extent}}. + + \sa as_bytes(), size_bytes() +*/ |