Earlier quoted context omitted.
They are the same value , but with different identities . vs[0], vs[1] etc. are different objects , but they are all initialized with the same value. The difference is kind of irrelevant for a constant object like an empty tuple. But imagine the following program: fn main() { let mut vs = [(1,), (1,), (1,), (1,), (1,)]; vs[0].0=2; for v in vs { println!("{:?}", v); } } Here we can see that identity is in fact importa…
> They are the same value, but with different identities. vs[0], vs[1] etc. are different objects What allows you to say that they have different identities? They are zero-sized types. Literally zero. `()` is a type and `()` its the only possible value. log(1) = 0 bit. If you look into machine code you will not find anything that you can call an object. The very existence of `()` is a shared dream of a programmer and…
Syntactic analogy with non-zero sized types. If you want a special case that says "there is a single object of the zero-sized type" that's ok, but it's a special case. All other types have a difference between object identity and value equality.
> Will all addresses be equal?
No, because C++ doesn't optimize for ZSTs, and it doesn't modify semantics for const. I agree that C++ pays a price for these two things, but I don't think it's because it "insists all objects have different addresses", I believe that is just a consequence to not giving special semantics to const beyond disallowing writes.