This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.

707. null pointer constant for exception_ptr

Section: 16.9.6 [propagation] Status: NAD Submitter: Jens Maurer Opened: 2007-07-20 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [propagation].

View all issues with NAD status.


From the Toronto Core wiki:

What do you mean by "null pointer constant"? How do you guarantee that exception_ptr() == 1 doesn't work? Do you even want to prevent that? What's the semantics? What about void *p = 0; exception_ptr() == p? Maybe disallow those in the interface, but how do you do that with portable C++? Could specify just "make it work".

Peter's response:

null pointer constant as defined in 7.3.11 [conv.ptr]. Intent is "just make it work", can be implemented as assignment operator taking a unique pointer to member, as in the unspecified bool type idiom.

[ Bellevue: ]

Original implementation was possible using the "unspecified-null-pointer" idiom, similar to unspecified-bool.

Even simpler now with nullptr_t.

NAD Rationale : null pointer constant is a perfectly defined term, and while API is clearly implementable there is no need to spell out implementation details.

Proposed resolution: