On Monday, 1 February 2016 at 18:28:05 UTC, Artur Skawina wrote:
On 01/31/16 23:11, Steven Schveighoffer via Digitalmars-d-learn wrote:
Thanks! I was surprised this is not straightforward.

   enum isLvalue(alias A) = is(typeof((ref _){}(A)));

artur

That looks much nicer. It still needs work to properly handle functions with non-empty argument lists. Also, can alias parameters take runtime variables? I can't remember.

struct S
{
    int w(int n) { return 1; }
}

static assert(isLvalue!(S.w));

Reply via email to