On 17/05/2015 15:19, Giuseppe D'Angelo wrote:
> On Sun, May 17, 2015 at 2:30 PM, Andre Somers <[email protected]> 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
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to