__traits(getMember) and uniform call syntax

Tomek Sowiński just at ask.me
Sat Oct 16 17:24:25 PDT 2010


Tomek Sowiński napisał:

> What's the status quo on member functions defined outside the type?
> 
> import std.array;
> 
> void main() {
>     int[] arr = [1,2];
>     
>     // compiles, should it?
>     int a = __traits(getMember, arr, "front");
> 
>     // compiles (called popFront), should it?
>     __traits(getMember, arr, "popFront");
> 
>     // doesn't compile
> //     __traits(getMember, arr, "popFront")();
> }
> 
> 
> I'd appreciate if someone told apart bugs from features.

The latter two are compiler bugs to me, __traits(getMember, ...)() should work, but please 
shed some light regardless.

-- 
Tomek


More information about the Digitalmars-d mailing list