On Monday, 8 December 2014 at 20:54:54 UTC, Dicebot wrote:
But was there any reason why those traits (alien to type qualifiers) were pursued? What is the problem with `ref` simply meaning `non-null pointer` and allowing non-idempotent ref(ref(int))?
Please no. when you do int a; and then use a, you always either refer to a, to memory storage (lvalue) or a, the value stored in that memory (the rvalue). When doing ref int a = xxx; You specify that you don't create a new storage for a, but that you must consider xxx as an lvalue, and bind the name a to that same lvalue. Once you get that, you get why ref(ref(int)) do not make any sense, and is generally undesirable.