summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-04-03 09:36:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-07 12:11:39 +0200
commit89fb2271f377d1194f3311124daef97504e6ead9 (patch)
treee64f09463e7ca129e49f8199961dab9ff7284dba /src/corelib/tools/qsharedpointer.cpp
parent509428decc0bf8407c63581f16b4ee27b2cfda1d (diff)
QSharedPointer: allow one create() argument in C++98, too
Survey says that most uses of QSharedPointer(T*) in Qt that could benefit from variadic create() pass only a single argument. In order to prevent all such uses from #ifdef'ing on the complex condition that enables the variadic version, provide a single-argument version (for lvalues only, obviously) for C++98, too. Change-Id: I22ad251a20bbf80867cc31eaa3bcec677bde4359 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 2ced3d6a7c..58a9a021d0 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -630,9 +630,15 @@
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 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, you must use the overload
+ \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.
*/