On Thursday, 4 July 2019 at 15:22:08 UTC, Marco de Wild wrote:
On Thursday, 4 July 2019 at 15:10:05 UTC, aliak wrote:
[...]
I don't know if it will solve your whole problem, but have you
tried __traits(isSame, W0.fun, fun)?
Reduced example:
struct Foo(alias fun){
alias bar = fun;
}
void stuff(alias fun, T)(T t)
{
static if(__traits(isSame, fun, T.bar)) {
pragma(msg, "Yes");
} else {
pragma(msg, "No");
}
}
void a(){}
void b(){}
void main()
{
stuff!a(Foo!a()); // Yes
stuff!a(Foo!b()); // No
}
Of course! That helps a lot yes. Thank you :)
The case in the gist I pasted above works like a charm now.
isSame seems like a decent enough powerhouse to get most of the
practical cases it seems as well.