[Libreoffice] nullptr, was: Suggestion: Let's switch to using MSVC2010 on Windows for master

Lubos Lunak l.lunak at suse.cz
Wed Mar 16 10:02:37 PDT 2011


On Monday 14 of March 2011, Caolán McNamara wrote:
> On Mon, 2011-03-14 at 04:07 -0600, Tor Lillqvist wrote:
> > is nullptr supported in the gcc versions used on other platforms? So is
> > it better to just use 0 cast to the appropriate  pointer type instead?
>
> AFAIK nullptr is part of c++0x

 Correct.

> and available on gcc >= 4.6.0 in c++0x as 
> a built-in. It might be available in non c++0x-mode with an extra
> include, but as far as I know its not in earlier gccs, so a
> static_cast<pointer_type*>(0) is probably the best way to go when it
> arises.

 Even older gcc versions have kind of nullptr, namely NULL. I.e. NULL is not 
just 0 or (void*)0, but an internal type called __null that really represents 
a null pointer. I can't find the exact details since which gcc version this 
has been the case, but I assume that if msvc and gcc are the only compilers 
we care about, then we could switch to nullptr and #define it ourselves when 
not provided by the compiler automatically.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list