diff --git a/src/corelib/thread/qthreadstorage.h b/src/corelib/thread/qthreadstorage.h index d81c8d85d89..77d15485b6f 100644 --- a/src/corelib/thread/qthreadstorage.h +++ b/src/corelib/thread/qthreadstorage.h @@ -115,18 +115,17 @@ class QThreadStorage #else // !QT_CONFIG(thread) -#include - +#include #include template -inline bool qThreadStorage_hasLocalData(const QScopedPointer &data) +inline bool qThreadStorage_hasLocalData(const std::unique_ptr &data) { return !!data; } template -inline bool qThreadStorage_hasLocalData(const QScopedPointer &data) +inline bool qThreadStorage_hasLocalData(const std::unique_ptr &data) { return !!data ? *data != nullptr : false; } @@ -150,14 +149,14 @@ class QThreadStorage private: struct ScopedPointerThreadStorageDeleter { - static inline void cleanup(T *t) + void operator()(T *t) const noexcept { if (t == nullptr) return; qThreadStorage_deleteLocalData(t); } }; - QScopedPointer data; + std::unique_ptr data; public: QThreadStorage() = default;