The problem is that your appender is a char appender, and you try to put a dstring into it. Replace :

charAppender.put(totalStr);

by :

foreach(elem; totalStr){
   charAppender.put(elem);
}

elem will be a dchar, so it will work.


But I can see in the example of array.appander(http://dlang.org/phobos/std_array.html#appender)

int[] a = [ 1, 2 ];
auto app2 = appender(a);
app2.put(3);
app2.put([ 4, 5, 6 ]);  ---> appender accepts another array.

Why this is not same with dchar ?

Reply via email to