diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-11 20:57:26 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-14 20:58:51 +0200 |
commit | a095a999a3904a53e78857759a79a0e8c7d8a474 (patch) | |
tree | cffb4b7a44eff0355d2852c9d9db41aa3a36e988 /src/corelib/kernel/qsocketnotifier.h | |
parent | a8dc2a5b6dda85d63dd8f9f7570069df008941c6 (diff) |
Long live Q_IMPLICIT!
C++20 will give us explicit(bool). While we can't use it just yet
in its full potential, we can introduce a macro to start marking
our implicit conversions (aka `explicit(false)`), removing the need
for /* implicit */-like comments.
Port a few usages to it.
Change-Id: I336d5e4c8d51d8329627900d1059e59062c5cafd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/kernel/qsocketnotifier.h')
-rw-r--r-- | src/corelib/kernel/qsocketnotifier.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h index 528f58a1e1..b8a5cc542a 100644 --- a/src/corelib/kernel/qsocketnotifier.h +++ b/src/corelib/kernel/qsocketnotifier.h @@ -102,14 +102,14 @@ public: #define Q_DECL_CONSTEXPR_NOT_WIN Q_DECL_CONSTEXPR #endif - /* implicit */ Q_DECL_CONSTEXPR_NOT_WIN + Q_DECL_CONSTEXPR_NOT_WIN Q_IMPLICIT QSocketDescriptor(DescriptorType descriptor = DescriptorType(-1)) noexcept : sockfd(descriptor) { } #if defined(Q_OS_WIN) || defined(Q_QDOC) - /* implicit */ QSocketDescriptor(qintptr desc) noexcept : sockfd(DescriptorType(desc)) {} - operator qintptr() const noexcept { return qintptr(sockfd); } + Q_IMPLICIT QSocketDescriptor(qintptr desc) noexcept : sockfd(DescriptorType(desc)) {} + Q_IMPLICIT operator qintptr() const noexcept { return qintptr(sockfd); } Q_DECL_CONSTEXPR Qt::HANDLE winHandle() const noexcept { return sockfd; } #endif Q_DECL_CONSTEXPR operator DescriptorType() const noexcept { return sockfd; } |