2011/6/6 KennyTM~ <[email protected]>: > Maybe better > > auto ref opDispatch(string name, T...)(auto ref T args) { > mixin("return ." ~ name ~ "(this, args);"); > } > > so that ref-returns and ref-parameters can be handled as well. Doesn't work > for 'lazy' though. It also cannot preserve 'pure'-ity, 'nothrow'-ness and > '@safe'-ty of the original function. > >
As far as I understand, auto ref is supposed to mean "always ref, and accept r-values". So we would need to allow tuples to contain ref types and construct it from the target function. Torarin
