On 08/12/2016 01:24 PM, Robert burner Schadek wrote: >> No, the DIP doesn't handle several levels of indirection. > > What about: > > struct Bar { int a; int b } > auto rcs = RefCountedTree!(string,Bar)(); > > fcs["bar"].a = 1337; // log n > fcs["bar"].b = 1338; // log n > > ? I need to pay log n twice to assign two members
Note though that while it won't work with example of `RefCountedSlice` implementation in DIP (which marks return value as scope reducing lifetime to expression), it should be possible to instead mark method itself (== hidden `this` argument) as `return scope` thus saying that return value has same lifetime as `this`.
signature.asc
Description: OpenPGP digital signature