Under gcc (and possibly other compilers) it is possible to write:
auto t = new decltype(nullptr);
I'm not sure what this does. Does that allocate memory for an object of type nullptr_t?
My question is not about the type of nullptr that is nullptr_t , my question is how does new nullptr_t() make sense ?
Does that allocate memory for an object of type
nullptr_t?
Yes.
my question is how does
new nullptr_t()make sense ?
From a syntactic point of view, there is nothing wrong with that.
From a semantic point of view, I can't see any sensible use case for it. All instances of nullptr_t are essentially the same from a usage point of view.
But then, someone might come up with a good use case that we have not been exposed to yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With