[Development] Upgrading the sources to C++11 keywords (Q_NULLPTR, etc.)

Matthew Woehlke mw_triad at users.sourceforge.net
Wed Feb 11 00:37:18 CET 2015


Marc, I'm not sure if you're arguing for or against nullptr :-)...

On 2015-02-10 18:23, Marc Mutz wrote:
> On Tuesday 10 February 2015 20:13:12 André Pönitz wrote:
>> Can't you simply wait until 'nullptr' is available?
> 
> No.
> 
> For a simple reason: using nullptr (Q_ or not) is more expressive than 0. And 
> why would i want to throw away information I already have?

(Oh... and 'auto ptr = 0;' does not give you a pointer. Not relevant to
Qt, but just saying...)

>> Do you really *need* to use macros instead of the core language?
> 
> Do you use 'emit' when you emit signals? Lemme tell you: It's a pesky macro 
> and it just adds line noise.

I do use 'emit'. It adds information, not noise. When I see 'emit', I
know that I am emitting a signal and not just calling some method. I can
also search my code for 'emit'. (Searching for signal emissions is very
hard if I am not using 'emit'.)

Similarly, if for some reason I need to know where a null pointer
occurs, I can at least search for 'nullptr' and know I will not get
false positives. Try that with '0' and you will get *LOTS* of false
positives. (I may not find all of them, but the ones I'd miss, I'd miss
regardless of using '0' or 'nullptr'.)

-- 
Matthew




More information about the Development mailing list