From 4d55feb7435117fe0889ba95eb3a3aa1a19aa1f5 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 23 Feb 2024 15:29:21 +0100 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira --- src/corelib/serialization/qdatastream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index ac557c1bb13..efcc23e49a8 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 , bool>, bool> = true> + std::enable_if_t, bool> = true> QDataStream &operator<<(T i) { return (*this << qint8(i));