On 29/08/13 16:21, Artur Skawina wrote:
In order to handle ref-returns it would have to be more likestruct EnforceWrapper(T) { T t; auto ref opDispatch(string M, Args...)(Args args) { {/*before code*/} scope (exit) {/*after code*/} return mixin("t." ~ M ~ "(args)"); } } and need another two overloads for property/field getters and setters. Handling ref-args would add more complexity, but in many cases ignoring them or using auto-ref is enough.
Interesting. When it comes down to it, it looks like what you're proposing is an extended version of Proxy, no .... ?
