On 06/11/2018 08:46 AM, cc wrote:
struct MYUDA {}
class Foo {
@(MYUDA) int bar(int x) { return x*2; }
}
auto foo = new Foo();
[...]
I did figure out I can do it with mixins like so:
void MCALL(string func, V...)(V args) {
mixin(`assert(hasUDA!(`~func~`, MYUDA));`); // Ok
mixin(`
Is it possible to pass a class member function as a template
argument in such a way that it can 1. be called during runtime,
and 2. still retrieve the UDAs of the function itself? For
example, given this setup:
struct MYUDA {}
class Foo {
@(MYUDA) int bar(int x) { return x*2; }
}
auto