Hacker News new | ask | show | jobs
by Someone 1414 days ago
I may be overlooking something, but I don’t see a realistic use case for having multiple empty tuples without an address.

If you have those, I don’t see any way to discriminate between them. If so, why would you ever want to have more than one of a given type? Is there some template code that might accidentally try to create them?

1 comments

Rust `Set<T>` is implemented as `Map<T, ()>`. Go is similar, but you have to do it manually. Zero-sized types mainly have use in generics (so yes-ish by templates, but not accidental).
Still, why would you ever have multiple, if there’s no way to discriminate between them because you can’t mutate them or obtain their address?