static struct Struct { int opUnary(string op)() if(op == "+") { return 42; } int opUnary(string op)() if(op == "~") { return 33; } } static assert([UnaryOperators!Struct] == ["+", "~"]);
See Implementation