Alias this and std.traits.isArray

David d at dav1d.de
Wed Jan 9 13:57:11 PST 2013


> Like this?
> 
> struct MyType(Elem)
> {
>     Elem[] inner;
>     alias inner this;
> }
> 
> void main()
> {
>     static assert(is(MyType!float _ : T[], T));
> }
> 

And how does that work for a static array?


More information about the Digitalmars-d mailing list