[Development] RFF: nullptr rules

Olivier Goffart olivier at woboq.com
Thu Dec 10 11:12:42 CET 2015


On Thursday 10. December 2015 10:52:15 Mathias Hasselmann wrote:
> Am 09.12.2015 um 17:45 schrieb Mathias Hasselmann:
> > Am 09.12.2015 um 16:14 schrieb Marc Mutz:
> >> Arguments in favour:
> >> - it's the C++ way of writing the null pointer constant these days
> >> - we need to use it in headers, anyway, to allow people to use
> >> -Wzero-as...,
> >> 
> >>    and it makes no sense to have two sets of rules for headers and impl
> >> 
> >> - it can disambiguate code and prevent accidents
> >> - in some situations, it makes code easier to understand (:
> >> m_foo(nullptr)).
> >> 
> >> Arguments against:
> >> - it's uglier than "0", and more to type
> > 
> > Have we discussed "{}" instead of "nullptr", or "0" already?
> 
> This actually was a serious question: What are the opinions on using
> "{}" instead of "0" or "nullptr" to initialize a pointer?

We still support compilers that does not support uniform initialization.

--
Olivier 

Woboq - Qt services and support - http://woboq.com - http://code.woboq.org




More information about the Development mailing list