the Result Type

seany seany at uni-bonn.de
Sun Dec 8 00:24:53 PST 2013


std.algorithm.splitter seems to return all its return values as a 
type "Result", without quotes, and i dont not seem to be able to 
cast it to string[] or int[]  with cast(string[]) ( or even cast 
(string) - i tried that too).

I tried to use a function

void function(T, R)(T arr, out R output)
{

foreach(elem; arr)
{
     output ~= elemM
}
}

i have an occasion where R is int[], and one where it is 
string[]; and
but it says, that int can not be appended to string[], and string 
can not be appended to int[], and compilation fails.

Nonetheless removing either of the occasions, solves it.

how to deal with  this Result type?


More information about the Digitalmars-d-learn mailing list