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

Julien Blanc julien.blanc at nmc-company.com
Mon May 18 12:07:47 CEST 2015


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.

That said, i wish there were a « ref X » or « out X » keyword needed 
when calling a function that takes a reference, like in C# or Ada. In 
C++, you should resort to const-correctness to prevent mistakes. I like 
the suggested idea of highlightings potentially modified parameters in 
qtcreator.

Regards,

Julien



More information about the Development mailing list