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

André Pönitz apoenitz at t-online.de
Mon Feb 9 21:30:53 CET 2015


On Mon, Feb 09, 2015 at 09:11:54PM +0100, Marc Mutz wrote:
> On Monday 09 February 2015 19:49:19 André Pönitz wrote:
> > I am fairly sure that we won't reach consensus on what the set of such
> > selected places exactly look like, that's why the plan to reach some
> > conclusion was to restrict a part of the discussion to one case where I
> > think there's a chance to get consensus that the use of the Q_NULLPTR
> > macro is "obvious" nonsense.
> 
> I find it confusing that in one mail you argue that introducing Q_NULLPTR in 
> passing (= the way we do formatting changes) introduces inconsistency, and in 
> another mail you're looking for "selected places" where "Q_NULLPTR makes 
> sense".
> 
> Which one should it be?

It simply depends on the location. And .cpp vs .h is a pretty good first
approximation for a sensible rule in this case.

> If there's one universal rule, it's that less rules are easier to follow. So:
> 
> "Q_NULLPTR everywhere" instead of "in headers or [list of selected places]".

The universal rule is 'use it when it has an obvious advantage', not
'use it whenever the compiler accepts it'.

Pretty much the same rule as for any other feature of the language.

And it's not a new rule for Qt either. There are a lot of things that
are not acceptible in the public interface but completely fine in
the implementation.

> KIS, dude :)

Will you propose to use 'auto' instead of 'int' whenever it compiles?
Just because 'auto' *sometimes* makes sense?

Wait.

I don't think I am ready for your answer.

Andre'



More information about the Development mailing list