Does C++ have a unit type?
C++ has arbitrarily many unit types, including
std::nullptr_t
std::monostate
std::tuple<>
struct unit {};
It's called std::monostate
(Since C++17). It also overloads the ==
operator to return true, as well as some other operators, so that all instances of std::monostate
are equal.