On 07/23/13 08:38, Jacob Carlborg wrote: > static bool doesFieldSync (string field) () > { > alias attrs = TypeTuple!(__traits(getAttributes, mixin("FileData." ~ > field))); > return staticIndexOf!(Sync, attrs) != -1; > } > > The important things here are that __traits(getAttributes) returns a tuple. > You cannot assign a tuple to a variable.
We can. :) enum attrs = __traits... // `auto` would work too. Just be careful and remember the `typeof(attrs)` part if/when using staticIndexOf with types - it might otherwise return bogus results (instead of failing). staticIndexOf!(Sync, typeof(attrs)) artur