alias BlackHole(Base) = AutoImplement!(Base, generateEmptyFunction);
interface I
{
int foo();
string bar();
}
auto i = new BlackHole!I();
// generateEmptyFunction returns the default value of the return type without doing anything
assert(i.foo == 0);
assert(i.bar is null);
import std.exception : assertThrown;
alias WhiteHole(Base) = AutoImplement!(Base, generateAssertTrap);
interface I
{
int foo();
string bar();
}
auto i = new WhiteHole!I();
// generateAssertTrap throws an exception for every unimplemented function of the interface
assertThrown!NotImplementedError(i.foo);
assertThrown!NotImplementedError(i.bar);
Predefined how-policies for AutoImplement. These templates are also used by BlackHole and WhiteHole, respectively.