[Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

Koehne Kai Kai.Koehne at theqtcompany.com
Mon May 18 12:17:32 CEST 2015

> -----Original Message-----
> From: development-bounces+kai.koehne=theqtcompany.com at qt-
> project.org [mailto:development-
> bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of
> Julien Blanc
> Sent: Monday, May 18, 2015 12:08 PM
> To: development at qt-project.org
> Subject: Re: [Development] QTextStream::readLine(0) is an ambiguous
> overload in 5.5
> On 17/05/2015 15:19, Giuseppe D'Angelo wrote:
> > On Sun, May 17, 2015 at 2:30 PM, Andre Somers
> <andre at familiesomers.nl> wrote:
> >> In the spirit of option b), would it be an option to have the method
> >> take a QString& instead of a QString*? That would resolve the ambiguity.
> > It would solve, but Qt APIs use pointers instead of references for
> > out-arguments (and that's a very good code policy).
> That *was* a good policy (it has its drawbacks). C++11 tends to remove
> the need of raw pointers, C++14 makes a step further in that direction.
> Sticking to such a rule would mean going against the general evolution
> of the language.

Can you elaborate? We're talking about in/out parameters here, where
raw pointers IMO are still perfectly valid. What do you expect the signature 
of readLine(QString *line) to be in C++14?

Herb Sutter had a nice blog post about this a while ago:


He suggests to "use a * if you need to express null [...], otherwise prefer to use a &" though, where our coding standard suggests to use * for out parameters. Anyhow, this is an old argument that has nothing to do with C++11 , or smart pointers ... 



More information about the Development mailing list