diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-05-03 11:53:18 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-05-05 17:34:43 +0000 |
commit | 82ddecfb17158c35de1d0740dd7ecd5562d41726 (patch) | |
tree | 42fb0ecc0760cf4d98542d41cd2899d6edcab71f /src/corelib/tools/qvector.h | |
parent | b5547e49cd1760ba5d100dcc720e6366cbd23f06 (diff) |
Deprecate {to,from}Std{List,Vector}
ask our users to use the range constructors instead. This will allow
us to remove the include dependency towards <list> and <vector> in
Qt 6.
Change-Id: Id90f2058432e19941de1fa847100a7920432ad71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r-- | src/corelib/tools/qvector.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index d6baa76a30..4e148c9c55 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -49,7 +49,9 @@ #include <iterator> #include <initializer_list> +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) #include <vector> +#endif #include <stdlib.h> #include <string.h> @@ -292,10 +294,14 @@ public: static QVector<T> fromList(const QList<T> &list); +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + Q_DECL_DEPRECATED_X("Use QVector<T>(vector.begin(), vector.end()) instead.") static inline QVector<T> fromStdVector(const std::vector<T> &vector) { QVector<T> tmp; tmp.reserve(int(vector.size())); std::copy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } + Q_DECL_DEPRECATED_X("Use std::vector<T>(vector.begin(), vector.end()) instead.") inline std::vector<T> toStdVector() const { return std::vector<T>(d->begin(), d->end()); } +#endif private: // ### Qt6: remove methods, they are unused void reallocData(const int size, const int alloc, QArrayData::AllocationOptions options = QArrayData::Default); |