[Issue 10193] Template args to UDA's
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu May 22 03:40:03 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=10193
--- Comment #5 from Manu <turkeyman at gmail.com> ---
Can we have some movement on this?
std.simd is blocked on this issue.
Here's the thing:
enum targets[] = [ "hello", "world" ];
@attribute("target", targets[Target])
T func(int Target, T)(T arg)
{
return arg;
}
The UDA is based on a template arg, and this doesn't work.
I try and expand it manually:
template func(int Target, T)
{
@attribute("target", targets[Target])
T func(T arg)
{
return arg;
}
}
But this doesn't work either, it complains:
Error: template func cannot deduce function from argument types
!()(__vector(int[4])), candidates are: ...
Is there a workaround solution available?
It'd be nice to support this directly as in the OP.
--
More information about the Digitalmars-d-bugs
mailing list