#include #include struct d_actor { inline actor; }; struct msg_wrapper { int b; inline message; }; void ^?{}( msg_wrapper & this ) { sout | "msg_wrapper dtor"; } struct d_msg { int m; inline msg_wrapper; }; void ?{}( d_msg & this, int m, int b ) { this.m = m; this.b = b; set_allocation( this, Delete ); } void ^?{}( d_msg & this ) { sout | "d_msg dtor"; } allocation receive( d_actor &, d_msg & msg ) { sout | msg.m; sout | msg.b; return Finished; } struct d_msg2 { int m; inline msg_wrapper; }; void ^?{}( d_msg2 & this ) { sout | "d_msg2 dtor";} allocation receive( d_actor &, d_msg2 & msg ) { sout | msg.m; return Finished; } int main() { processor p; { actor_start(); // sets up executor d_actor da; d_msg * dm = alloc(); (*dm){ 42, 2423 }; da | *dm; actor_stop(); // waits until actors finish } { actor_start(); // sets up executor d_actor da; d_msg2 dm{ 29079 }; set_allocation( dm, Nodelete ); msg_wrapper * mw = &dm; message * mg = &dm; virtual_dtor * v = &dm; da | dm; actor_stop(); // waits until actors finish } }