Re: __traits(isRef, this) cannot distinguish l-value- from r-value-passed this

2017-01-18 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 19 January 2017 at 00:44:51 UTC, Nordlöw wrote: Any clues on how to retrieve this information? Another much more common use case: Chained property setters could be optimized iff the property setter is called on an r-value, that is when `__traits(isRef,this)` is `false`

__traits(isRef, this) cannot distinguish l-value- from r-value-passed this

2017-01-18 Thread Nordlöw via Digitalmars-d-learn
A compilation of struct T { int x; @disable this(this); // this has no effect on the issue ref inout(T) memberFun() inout { pragma(msg, "memberFun:", __traits(isRef, this) ? "ref" : "non-ref", " this"); return this; } } void freeFun()(auto ref const T x)