formattedWrite writes nothing

2014-05-02 Thread ref2401 via Digitalmars-d-learn
class MyClass { Appender!string _stringBuilder; this() { _stringBuilder = Appender!string(null); _stringBuilder.clear(); } @property string str() { return _stringBuilder.data; } void append(string

Re: formattedWrite writes nothing

2014-05-02 Thread Andrej Mitrovic via Digitalmars-d-learn
On 5/2/14, ref2401 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: class MyClass { Appender!string _stringBuilder; this() { _stringBuilder = Appender!string(null); _stringBuilder.clear(); Ouch, ouch, ouch! What's happening is that the

Re: formattedWrite writes nothing

2014-05-02 Thread anonymous via Digitalmars-d-learn
On Friday, 2 May 2014 at 10:23:03 UTC, Andrej Mitrovic via Digitalmars-d-learn wrote: Ouch, ouch, ouch! What's happening is that the 'clear' Appender method is only compiled-in if the data is mutable, otherwise you end up calling the object.clear UFCS function. So don't use clear here. I don't

Re: formattedWrite writes nothing

2014-05-02 Thread Jared Miller via Digitalmars-d-learn
I logged this bug a while ago: https://issues.dlang.org/show_bug.cgi?id=10291 On Friday, 2 May 2014 at 10:06:43 UTC, ref2401 wrote: Is it a bug or is there a reason for such behaviour?