put string[] into a appender without loop?

AsmMan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 21 16:48:57 PDT 2014


On Sunday, 21 September 2014 at 23:41:58 UTC, AsmMan wrote:
> I'd like to copy an array string into a appender!string() but I 
> can't see how to do this without loop myself over the string 
> array. Is there a native function or should I write it myself?

call:

auto app = appender!string();
	string[] s = ["foo", "baa"];
	app.put(s);

give a:

\src\phobos\std\conv.d(9,9): Error: static assert  
"immutable(char) cannot be emplaced from a string." (b)

How do I fix it?


More information about the Digitalmars-d-learn mailing list