isRef, isLazy, isOut

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Dec 19 11:47:20 PST 2009


Eldar Insafutdinov wrote:
> Following the commits to the dmd repository I found these traits implemented. The idea is good, but the API chosen does not look right.  Why not have __traits(storageClass, symbol) and a enum which defines the return value:
> enum StorageClass {
>     None,
>     Ref,
>     Lazy,
>     Out
> }
> 
> One could write templates isRef, isLazy etc on top of that if he/she really needs. IMO this is a cleaner way to implement this particular feature.

I asked in vain for is(var == ref), is(var == out) etc.

Andrei



More information about the Digitalmars-d mailing list