[Development] Fwd: QTextStream::readLine(0) is an ambiguous overload in 5.5
Alejandro Exojo
suy at badopi.org
Mon May 18 14:56:12 CEST 2015
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
modified".
And if you don't agree with argument, note that it's what Qt users might
expect since Qt 4 at least:
http://doc.qt.digia.com/qq/qq13-apis.html#pointersorreferences
"(...) 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.:
https://google-
styleguide.googlecode.com/svn/trunk/cppguide.html#Reference_Arguments
--
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net
More information about the Development
mailing list