[Development] QDataStream: blackbox or document all versions?

Marc Mutz marc.mutz at kdab.com
Mon Sep 26 09:48:17 CEST 2016


On Sunday 25 September 2016 19:40:06 Thiago Macieira wrote:
> But that brings us to QDataStream's biggest advantage: the wealth of
> available  operator<<.

Which is also one of its major drawbacks: Streaming out may invoke any 
implicit conversions, and while the worst of these are probably caught be the 
streaming-in code, which disables most implicit conversion by way of taking an 
lvalue reference, the derived-to-base class conversion is still performed, 
with bad potential side effects for both Qt and the user (cf. the recent 
QDBusArgument::op<<(QList) issue[1]).

Thanks,
Marc

[1] QtBase commits d55f2b1fb9c910bc118f75967a0e6273f8aa98d1 and 
5f542f3cca13f2da58b82aee2efbaffefeee00a7

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - Qt, C++ and OpenGL Experts



More information about the Development mailing list