C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standardising 0xdeadbeef for pointers

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 3 Aug 2025 15:48:08 +0100
I'm going off on a tangent here, but imagine if we could mark a function
(or lambda) as follows:

   int Func(double) throw_on_nullptr
   {
        . . .
   }

If you try to dereference a nullptr in this function, or if you perform
addition or subtraction on a nullptr, it throws std::nullptr_t.

Maybe?





>

Received on 2025-08-03 14:48:10