Casting the Result of splitter() into a string array
GreatEmerald
pastas4 at gmail.com
Sun Jun 17 04:39:19 PDT 2012
A quick and simple question, but I couldn't find the answer to it
by myself: how do I cast the return type of std.array.splitter()
into a string[]?
According to the compiler, splitter() has a return type Result.
How useful... I assume it's a disguised tuple? If I try to simply
assign the result to a string array, like this:
string[] Bits = splitter(" a b");
I get an error "Error: cannot implicitly convert expression
(splitter(" a b")) of type Result to string[]". Then if I make an
explicit cast, I get "Error: cannot cast from Result to string[]".
So there must be something obvious that I'm missing... I also had
the same problem when trying to cast the result of
std.algorithm.filter!() to string[].
More information about the Digitalmars-d-learn
mailing list