applyWrap

Scans the method wrapped by the caller.

string
applyWrap
(
string f = __FUNCTION__
R...
)
(
ref R returns
)

Parameters

f

The caller' s name. Autodetected.

returns R

The variables that get the result of each wrapped function. They must be references.

Return Value

Type: string

A string that has to be mixed in the caller's body.

Examples

static bool int42, int8, ffree1, ffree2;

static struct Inner
{
	void foo(int p0, int p1){int42 = true; int8 = true;}
	void bar() {ffree1 = true;}
}

static void freeFunc()
{
	ffree2 = true;
}

static struct Composed
{
	Inner inner;

	@Wrap(["Inner:inner:foo", "Inner:inner:bar", "freeFunc"])
	void foo(int p0, int p1)
	{
		mixin(applyWrap());
	}
}

static  Composed c;
c.foo(42,8);
assert(int42 & int8 & ffree1 & ffree2);

Meta