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

Knoll Lars Lars.Knoll at theqtcompany.com
Wed Feb 11 08:27:24 CET 2015


To settle this, I am also with Andre and Simon.

I’m fine with keeping our headers warning free, so go ahead and use
Q_NULLPTR there (until we at some point can require c++11 and can replace
it with nullptr). But I don’t like littering our code with macros. Where
it’s use makes things clearer as in the example Thiago mentioned, I’m ok
to use it, but let’s not go and replace 0 with the macro in places where
things are unambiguous.

Once we can use C++11 unconditionally (and thus don’t have to use macros),
I’m happy to re-open the discussion about the .cpp files.

Cheers,
Lars

On 11/02/15 07:54, "Hausmann Simon" <Simon.Hausmann at theqtcompany.com>
wrote:

>I suppose that it is absolutely unlikely that we are going to find a
>consensus on what is purely an aesthetic issue.
>
>I for one am entirely with André and I do not like UPPERCASE macros in my
>face unless I can avoid them. It's aesthetics and I suppose there is
>little that will change that.
>
>As approver I will approve code that uses Q_NULLPTR but I expect others
>reviewing my code to respect my preference to use 0 until we can use
>nullptr.
>
>
>Simon
>
>
>  Original Message
>From: Marc Mutz
>Sent: Wednesday, February 11, 2015 00:19
>To: André Pönitz
>Cc: development at qt-project.org
>Subject: Re: [Development] Upgrading the sources to C++11 keywords
>(Q_NULLPTR, etc.)
>
>
>On Tuesday 10 February 2015 20:13:12 André Pönitz wrote:
>> On Tue, Feb 10, 2015 at 07:53:23PM +0100, Marc Mutz wrote:
>> > On Tuesday 10 February 2015 17:28:09 Thiago Macieira wrote:
>> > > On Tuesday 10 February 2015 15:34:45 Knoll Lars wrote:
>> > > > +1. I’m ok with us making sure our headers are clean against
>>warnings
>> > > > (if possible), but I don’t see a real need to enforce it’s usage
>>in
>> > > > implementations.
>> > >
>> > > Fair enough. But how about allowing people to change zeroes to
>> > > Q_NULLPTR?
>> >
>> > Even more importantly: what about new code?
>>
>> 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?
>
>> 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.
>
>So tell me.. where's the difference?
>
>Thanks,
>Marc
>
>--
>Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
>KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
>www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
>KDAB - Qt Experts - Platform-Independent Software Solutions
>_______________________________________________
>Development mailing list
>Development at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development
>_______________________________________________
>Development mailing list
>Development at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list