Bug 1919 – StringWriter docs are completely unclear
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-03-12T22:44:00Z
Last change time
2015-06-09T05:15:24Z
Assigned to
andrei
Creator
jlquinn
Comments
Comment #0 by jlquinn — 2008-03-12T22:44:32Z
The docs for StringWriter are as follows:
struct StringWriter(Char);
Implements the static Writer interface for a string. Instantiate it with the character type, e.g. StringWriter!(char), StringWriter!(wchar), or StringWriter!(dchar). Regardless of instantiation, StringWriter supports all character widths; it only is the most efficient at accepting the character type it was instantiated with.
This explanation generates a bunch of naive questions:
* What's the Writer interface (and don't make me search to find it)?
* What do I do with this struct?
* How does it accept chars?
* What does it do with the chars?
Comment #1 by andrei — 2008-03-13T00:41:32Z
Phobos does not have a streaming interface yet. I intended StringWriter as an intermediate solution for the new implementation of writef*. When Phobos will adopt a full-fledged streaming solution, StringWriter will be absorbed into it. For now, please consider StringWriter undocumented and not for general use. (I had to make it public due to a compiler bug.)
Comment #2 by jlquinn — 2008-03-13T07:05:02Z
(In reply to comment #1)
> Phobos does not have a streaming interface yet. I intended StringWriter as an
> intermediate solution for the new implementation of writef*. When Phobos will
> adopt a full-fledged streaming solution, StringWriter will be absorbed into it.
> For now, please consider StringWriter undocumented and not for general use. (I
> had to make it public due to a compiler bug.)
OK. Please consider adding the above text to the StringWriter doc for now, so that people aren't left wondering what it is.
Comment #3 by andrei — 2009-07-07T06:29:23Z
StringWriter has been replaced with std.array.Appender.