On 10/6/2015 7:57 PM, bitwise wrote:
What can a stream do that a range cannot?
I was trying to make my case for polymorphism, so I haven't thought much about
streams specifically, but one obvious thing that stands out is growing on
demand.
Stream s = new Stream(4);
s.write(1);
s.write(2); // underlaying buffer grows automatically
I don't see how you would do something like this with a range.
It's what an OutputRange does.
Again though, if I have to restate what I've been arguing for as simply as
possible, it's that I want to use RAII and polymorphism at the same time, as a
natural language solution. DIP74 would satisfy everything I'm asking for.
Yes. We need to do that.