diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-23 15:29:21 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-28 19:15:51 +0100 |
commit | 4d55feb7435117fe0889ba95eb3a3aa1a19aa1f5 (patch) | |
tree | efcf3ff175d2c3b29f6f480f70860392b0df7110 /src/corelib/serialization/qdatastream.h | |
parent | 1556a3a5eb13b05ccff5fb551ae9d72edb267e8d (diff) |
QDataStream: code tidies
As spotted in the code review, remove_cv here is useless. Since T is
passed by value, template type deduction will strip cv-ref for us.
(Also: in general we don't support users specifying template type
parameters except where authorized, but here they can't, as this is an
operator.)
Amends 3823e310e39426043dc7f0529a6fba33fe4d49f0
Change-Id: I5b5db38a4dcf4f1179d748cf0bb1b62a9896f5a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qdatastream.h')
-rw-r--r-- | src/corelib/serialization/qdatastream.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index ac557c1bb1..efcc23e49a 100644 --- a/src/corelib/serialization/qdatastream.h +++ b/src/corelib/serialization/qdatastream.h @@ -173,7 +173,7 @@ public: #if !defined(Q_QDOC) // Disable implicit conversions to bool (e.g. for pointers) template <typename T, - std::enable_if_t<std::is_same_v<std::remove_cv_t<T>, bool>, bool> = true> + std::enable_if_t<std::is_same_v<T, bool>, bool> = true> QDataStream &operator<<(T i) { return (*this << qint8(i)); |