On 3/31/2014 12:51 AM, Manu wrote:Of course it's reasonable - not many classes overload operators.
Now it's deceptive that it's a pointer, and the pointer semantics are not
suppressed. It might be surprising to find that a type that doesn't look like a
pointer behaves like a pointer.
You lose access to the operators, indexing/slicing etc, etc.
I don't see how this is a reasonable comparison to 'class' as a reference type
by definition.
The point is, there are numerous solutions available, you aren't stuck with one solution for every problem.
And, you can use 'alias this' as Adam showed to create a type with fully customized behavior - you don't have to change the language to prove your ideas.