summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-07-31 09:43:01 +0200
committerMarc Mutz <marc.mutz@qt.io>2025-08-01 10:53:59 +0200
commit642d747f17f54d9d8ccb3e2721c8a00f8d4409bb (patch)
treea580d41d5e25eaa490971c016bb496214674402e /src
parent646c134e4cf0f91621c2f25679d35a4452555785 (diff)
QFuture: simplify is_same<T, void> → is_void<T>
std::is_void is available since C++11, the same as std::is_same, so use it. Amends 1005c86c6101a9cdc5ce37de3fd5bc67505bf8bc, 44ceb56455c82df3e6b1c9a2fa373cac14a039f8 and 90d9a86c2e762c9426d0facbd54ed5dbff574ecd. Found while fixing CID-87769. Coverity-Id: 87769 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I7ae296b53e215ef33f923ac7aff2623de879f70e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qfuture.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h
index fdecae0e084..e09d9a43a8f 100644
--- a/src/corelib/thread/qfuture.h
+++ b/src/corelib/thread/qfuture.h
@@ -25,7 +25,7 @@ template <typename T>
class QFuture
{
static_assert (std::is_move_constructible_v<T>
- || std::is_same_v<T, void>,
+ || std::is_void_v<T>,
"A move-constructible type or type void is required");
public:
QFuture()
@@ -167,7 +167,7 @@ QT_WARNING_POP
class const_iterator
{
public:
- static_assert(!std::is_same_v<T, void>,
+ static_assert(!std::is_void_v<T>,
"It isn't possible to define QFuture<void>::const_iterator");
typedef std::bidirectional_iterator_tag iterator_category;
@@ -297,7 +297,7 @@ private:
friend struct QtPrivate::UnwrapHandler;
using QFuturePrivate =
- std::conditional_t<std::is_same_v<T, void>, QFutureInterfaceBase, QFutureInterface<T>>;
+ std::conditional_t<std::is_void_v<T>, QFutureInterfaceBase, QFutureInterface<T>>;
#ifdef QFUTURE_TEST
public:
@@ -438,7 +438,7 @@ template<typename T>
struct MetaTypeQFutureHelper<QFuture<T>>
{
static bool registerConverter() {
- if constexpr (std::is_same_v<T, void>) {
+ if constexpr (std::is_void_v<T>) {
return false;
} else {
return QMetaType::registerConverter<QFuture<T>, QFuture<void>>(