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
Type: 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

1 static bool int42, int8, ffree1, ffree2;
2 
3 static struct Inner
4 {
5     void foo(int p0, int p1){int42 = true; int8 = true;}
6     void bar() {ffree1 = true;}
7 }
8 
9 static void freeFunc()
10 {
11     ffree2 = true;
12 }
13 
14 static struct Composed
15 {
16     Inner inner;
17 
18     @Wrap(["Inner:inner:foo", "Inner:inner:bar", "freeFunc"])
19     void foo(int p0, int p1)
20     {
21         mixin(applyWrap());
22     }
23 }
24 
25 static  Composed c;
26 c.foo(42,8);
27 assert(int42 & int8 & ffree1 & ffree2);

Meta