using empty = nullptr

using Empty = nullptr; results in error expected a type specifier . After some research it turns out nullptr is of type std::nullptr_t but that doesn't work for my usecase.

I'd like to write something like int* emptySlot = Empty; // emptySlot should = nullptr;

Any way to do this?
Last edited on
Omg, it just came to me std::nullptr_t Empty = nullptr; I guess I should really rubberduck before posting. Lol.
Last edited on
It should probably be a constant.

 
constexpr std::nullptr_t Empty = nullptr;

Note that std::nullptr_t can be replaced with auto if you prefer.
Last edited on
Topic archived. No new replies allowed.