On Thu, Dec 04, 2014 at 12:41:58PM -0800, Walter Bright via Digitalmars-d wrote: [...] > struct RefCounted(T) > { > T t; > scope ref T borrow() { return t; } > alias this t; > } > > This enables RefCounted!T to be implicitly converted to a T, but with > a scoped result. This is a critical feature, one I spent a lot of time > thinking about, and hope it's right :-)
Hold on, how does this convert to T with a scoped result? Or did you mean: ... @property scope ref T borrow() { ... } alias borrow this; ? T -- Let's call it an accidental feature. -- Larry Wall