Kagamin wrote:
Andrei Alexandrescu Wrote:
In contrast with the original example this is not a bug.
I think it is to the extent (a) it does nothing (b) the syntactic
equivalent code involving fields does something. It's an egregious
breakage of consistency because properties were meant to be
generalizations of fields in the first place.
class File
{
...
}
struct MyStruct
{
File obj;
File obj2(){ return obj; }
}
MyStruct foo();
foo().obj.unlink();
foo().obj2().unlink();
Why do you think this is invalid?
I didn't think that's invalid. I was talking about the other example
that looked like a field assignment but did not assign to a field.
File does not have an unlink member but I get your point. As I said,
refusing to bind ref to rvalues disables a few valid uses. I am willing
to renounce those few uses.
Andrei