On Thursday, 11 August 2016 at 20:27:51 UTC, Michael Coulombe
wrote:
here is something for you to play with:
import std.stdio;
enum CallAllowed0;
enum CallAllowed1;
struct S {
@CallAllowed0 void foo () { writeln("foo()"); }
@CallAllowed1 void foo (int n) { writeln("foo(", n, ")"); }
}
On Thursday, 11 August 2016 at 20:41:33 UTC, ketmar wrote:
ah, my bad, i missed UDA part of the question. sorry. ;-)
On Thursday, 11 August 2016 at 20:27:51 UTC, Michael Coulombe
wrote:
import std.stdio;
struct S {
void foo () { writeln("foo()"); }
void foo (int n) { writeln("foo(", n, ")"); }
}
auto doit(string methodName, C, Args...) (C c, Args args) {
static if (is(typeof(mixin("c."~methodName~"(a
On Thursday, 11 August 2016 at 20:27:51 UTC, Michael Coulombe
wrote:
Is there a way to implement "getSymbolOfCall" and
"getDelegateOfCall" such that doit is functionally equivalent
to calling the method directly?
auto doit(C, string methodName, Args...)(C c, Args args) {
alias methodSymbol
Is there a way to implement "getSymbolOfCall" and
"getDelegateOfCall" such that doit is functionally equivalent to
calling the method directly?
auto doit(C, string methodName, Args...)(C c, Args args) {
alias methodSymbol = getSymbolOfCall!(c, methodName, Args);
pragma(msg, hasUDA!(meth