const bool has_attribute (T, string member, alias attribute) ()
{
// ok
mixin(
`foreach (type; __traits (getAttributes, T.`~member~`))`
`static if (is (type == attribute))`
`return true;`
);
// ok
foreach (type; mixin(`__traits (getAttributes, T.`~member~`)`))
static if (is (type == attribute))
return true;
// doesn't compile, member is not accessible error
foreach (type; __traits (getAttributes, mixin(`T.`~member)))
static if (is (type == attribute))
return true;
return false;
}
Comment #1 by monarchdodra — 2014-05-10T19:16:02Z
Could you provide the use case that triggers the error? I can't reproduce it.
Comment #2 by vlevenfeld — 2014-05-22T20:24:05Z
my apologies, I didn't understand how the mailing system worked at the time that I posted this and only now saw your comment - the use case has since been thoroughly paved over.
Comment #3 by monarchdodra — 2014-05-22T21:18:22Z
(In reply to Vlad Levenfeld from comment #2)
> the use case has since been thoroughly paved over.
Hum... Well, if we can't reproduce the issue, we'll have to close this.