This code doesn't work! -------------------------- import std.array, std.range; static assert(isOutputRange!(Appender!(ubyte[]), ubyte)); static assert(isOutputRange!(RefAppender!(ubyte[]), ubyte)); void main() {} -------------------------- $ dmd -run main main.d(4): Error: static assert (isOutputRange!(RefAppender!(ubyte[]),ubyte)) i s false
I think RefAppender should just be deprecated/scheduled for deprecation. It was a short term backwards compatibility hack from a long time ago.
(In reply to comment #1) > I think RefAppender should just be deprecated/scheduled for deprecation. It > was a short term backwards compatibility hack from a long time ago. Hmm... I understand it as follows: - It is the class which it is easy to be used in the wrong way. (User must not add elements to the array while appending with RefAppender) - The improper usage is easier to become the factor of the bug. - Therefore it is deprecated. Is this right? And, I think that it is necessary to satisfy at least one of the following conditions to make RefAppender deprecated: - Appender does not allow the similar improper usage. - Appender is as fast as the RefAppender. - Appender's memory efficiency is as well as RefAppender's.
https://github.com/D-Programming-Language/phobos/pull/502