Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2022-05-29 18:17:39


On 23/05/2022 22:06, Peter Dimov via Boost wrote:
> Ion Gaztañaga wrote:
>> On 22/05/2022 2:59, Peter Dimov via Boost wrote:
>>> Compilers apparently are warning on the use of 0 as a null pointer
>>> constant, suggesting we use nullptr instead. But compilers don't know
>>> that we support C++03 where nullptr isn't a thing.
>>>
>>> Case in point: https://github.com/boostorg/throw_exception/pull/22
>>>
>>> ifdef-ing every use of nullptr is unwieldy, so maybe we need
>>> BOOST_NULLPTR added to Boost.Config? That would expand to nullptr
>> when
>>> it's supported, and 0 otherwise.
>>
>> Maybe we need the boost::nullptr_t type, emulated in C++ mode and "typedef
>> decltype(nullptr) nullptr_t;" in compilers that support it...
>>
>> And if nullptr/nullptr_t is provided by Boost.Config, without any heavy-include
>> need, that would be perfect ;-)
>
> That's not what Boost.Config is for.

Just reviewing boost/cstdint.hpp, to know where "portable" types were
defined in Boost, surprisingly that is provided by Boost.Config.
Providing portable nullptr-like type/macro sounds pretty similar to me.

My 2 cents,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk