POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
6 Sep 2024 23:20:35 EDT (-0400)
  Re: C++ questions  
From: Warp
Date: 24 Sep 2008 14:08:20
Message: <48da8214@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Actually, many times I've seen NULL defined as
>    #define NULL ((void*)0)
> I'm not sure which (if either) such a thing would match in your C++ example.

  The problem with that is that void* is not implicitly castable to any
other pointer type in C++ due to C++ having stricter implicit casting
rules than C.

  You might try some clever tricks using templates and type conversion
operators, but then you will probably stumble accross problems with
method pointers and member variable pointers (which are one of the most
obscure features of C++).

  'nullptr' will be a generic null pointer which is implicitly convertible
to any other pointer type.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.