Disadvantages of ARC

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Feb 6 09:19:18 PST 2014


On Thu, Feb 06, 2014 at 04:30:31PM +0000, Dicebot wrote:
> On Thursday, 6 February 2014 at 16:25:37 UTC, Andrei Alexandrescu
> wrote:
> >// lib code
> >struct RCSlice(T) { ... }
> >alias rcstring = RCSlice!(immutable char);
> >rcstring rc!(string s) { ... }
> >
> >// user code
> >auto s1 = buildPath!("hello", "world");
> >auto s2 = buildPath!(rc!"hello", rc!"world");
> >
> >In this example s1 will have type string and s2 will have type
> >rcstring.
> 
> Looks unnecessary restrictive. Why can't one build rc-string from
> stack buffers or Array!char from rc-strings? Type of output buffer
> does not have to do anything with input.

Agree. Phobos algorithms that populate a data sink should migrate toward
using output ranges instead of returning a predetermined type. This will
not only address ARC needs, but a bunch of other things as well (output
range support/use in Phobos is still rather scanty at the moment).


T

-- 
MSDOS = MicroSoft's Denial Of Service


More information about the Digitalmars-d mailing list