reduce string ranges
Brian Myers
bmyers at harryanddavid.com
Tue Jun 3 16:52:57 PDT 2008
I'd like to be able to use the reduce template on a range of strings. The following:
int main(char[][] args)
{
string[] tstarr = ["one", "two", "three"];
writefln(reduce!("a ~ b")("", tstarr));
}
gives the following error message:
c:\dmd\bin\..\src\phobos\std\algorithm.d(289): Error: functions cannot return static array invariant(char[0u])
Is there another way to do this? I've tried both the ~ operator and the + operator.
Brian
More information about the Digitalmars-d
mailing list