disable all member function calls for rvalues?

Kagamin spam at here.lot
Wed Dec 23 03:36:19 PST 2009


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?



More information about the Digitalmars-d mailing list