|
|
|
|
|
by omnicognate
703 days ago
|
|
The distinct types are the whole point. You wouldn't want a std::tuple<> to be implicitly convertible to a std::optional<T> (for arbitrary T), and std::nullptr_t exists to be the type of nullptr, which captures the conversion behaviours appropriate for null pointer literals and has nothing to do with the variant use case std::monostate exists to serve. |
|
As for the std::variant use case, using std::monostate is only a matter of convention there. You could use any of the other unit types just the same.