diff options
authorGiuseppe D'Angelo <>2019-05-02 13:31:17 +0200
committerGiuseppe D'Angelo <>2019-05-02 16:18:43 +0000
commit513e29af1d1742abec5034e5d376f743c92f9e77 (patch)
parent595d816c58134ae11039bf8755afacf876130fb5 (diff)
QSharedPointer: fix docs for create()
In 5.12 only the variadic argument version is left (as all supported compilers have variadic templates). Remove the docs of the nullary overload, and fix the docs for the remaining overload. Change-Id: I54cc7ea71cc61ba1330a9ad92e4fa2ae7f749bac Reviewed-by: Thiago Macieira <>
2 files changed, 4 insertions, 27 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 6ab84cf3d8..95b584e914 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -649,19 +649,7 @@
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create()
- \since 5.1
- Creates a QSharedPointer object and allocates a new item of type \tt T. The
- QSharedPointer internals and the object are allocated in one single memory
- allocation, which could help reduce memory fragmentation in a long-running
- application.
- This function calls the default constructor for type \tt T.
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create(...)
+ \fn template <class T> template <typename... Args> QSharedPointer<T> QSharedPointer<T>::create(Args &&... args)
\since 5.1
@@ -671,18 +659,7 @@
This function will attempt to call a constructor for type \tt T that can
- accept all the arguments passed. Arguments will be perfectly-forwarded.
- \note This function is only fully available with a C++11 compiler that
- supports perfect forwarding of an arbitrary number of arguments.
- If the compiler does not support the necessary C++11 features,
- then a restricted version is available since Qt 5.4: you may pass
- one (but just one) argument, and it will always be passed by const
- reference.
- If you target Qt before version 5.4, you must use the overload
- that calls the default constructor.
+ accept all the arguments passed (\a args). Arguments will be perfectly-forwarded.
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 98b38b97d3..a2c5f990fc 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -97,8 +97,8 @@ public:
template <class X> QSharedPointer<X> constCast() const;
template <class X> QSharedPointer<X> objectCast() const;
- static inline QSharedPointer<T> create();
- static inline QSharedPointer<T> create(...);
+ template <typename... Args>
+ static inline QSharedPointer<T> create(Args &&... args);
template <class T>