[Development] Fwd: QTextStream::readLine(0) is an ambiguous overload in 5.5
Martin.Smith at theqtcompany.com
Mon May 18 15:25:08 CEST 2015
The reason I pressed the point is that you all seem to accept uncritically the statement that reference parameters are confusing. Of all the things I get confused about in C++, reference parameters isn't one of them. I do get confused, but I can't recall ever being confused by one. Aren't they more efficient, when 0 is not a permitted value? Would swap() be as efficient with pointers?
I suppose my bias arises from my ancient past, when there were always limits to contend with.
From: development-bounces+martin.smith=theqtcompany.com at qt-project.org <development-bounces+martin.smith=theqtcompany.com at qt-project.org> on behalf of Alejandro Exojo <suy at badopi.org>
Sent: Monday, May 18, 2015 2:56 PM
To: development at qt-project.org
Subject: Re: [Development] Fwd: QTextStream::readLine(0) is an ambiguous overload in 5.5
El Monday 18 May 2015, Smith Martin escribió:
> You omitted that toInt(&ok) is required to test ok for null, which is not
> required if ok is a reference.
That's extra work in the implementation in order support a nicer API to the
users, e.g. to support toInt() with the null value as default argument, in
addition to the "passing a pointer makes clear that the value could be
And if you don't agree with argument, note that it's what Qt users might
expect since Qt 4 at least:
"(...) I want to share some of our findings and present the principles we've
been using when designing Qt 4 (...)"
And it's common in more projects and code conventions, e.g.:
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net
Development mailing list
Development at qt-project.org
More information about the Development