"Tomasz Kupczyk" <[email protected]> a écrit:

> When is NULL not necessarily correct? I suppose it's better to read
> some rationale why nullptr is introduced :)

For instance:

    #define NULL (void*)0

    void foo(const char*);

    void
    bar()
    {
      foo(NULL);
    }

The GNU C compiler compiles this just fine, whereas the GNU C++ compiler
does not, because you can't cast a void* into a char*.

This is a case of a valid C definition of NULL, which is not valid in
C++.

-- 
                Dodji
_______________________________________________
nemiver-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/nemiver-list

Reply via email to