Doc: Fix \fn command for qScopeGuard(F &&f)

and tag it in the header file to ensure the documentation is matched.

Change-Id: Id1e7cd395ca0ec337845da9a207bfbf95db01064
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Topi Reinio 2020-03-17 20:50:04 +01:00
parent 737e7524e8
commit bd9a13b370
2 changed files with 2 additions and 1 deletions

View File

@ -96,6 +96,7 @@ private:
template <typename F> QScopeGuard(F(&)()) -> QScopeGuard<F(*)()>; template <typename F> QScopeGuard(F(&)()) -> QScopeGuard<F(*)()>;
#endif #endif
//! [qScopeGuard]
template <typename F> template <typename F>
#if __has_cpp_attribute(nodiscard) #if __has_cpp_attribute(nodiscard)
Q_REQUIRED_RESULT Q_REQUIRED_RESULT

View File

@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
*/ */
/*! /*!
\fn template <typename F> const QScopeGuard<F> qScopeGuard(F f) \fn [qScopeGuard] template <typename F> QScopeGuard<typename std::decay<F>::type> qScopeGuard(F &&f)
\inmodule QtCore \inmodule QtCore
\relates QScopeGuard \relates QScopeGuard
\brief The qScopeGuard function can be used to call a function at the end \brief The qScopeGuard function can be used to call a function at the end