Type of complex expression
    Lubos Pintes 
    lubos.pintes at gmail.com
       
    Wed Feb 27 02:02:59 PST 2013
    
    
  
Hi,
Some time ago I asked how to efficiently parse a space delimited list of 
ints to array. Ireceived a good answer, but recently I discovered this:
auto a="  1 2  3   4 5   "
   .split(" ")
   .filter!"!a.empty"
   .map!"to!int(a)";
writeln(a);
//writes [1, 2, 3, 4, 5] as expected.
But:
writeln(typeid(a).stringof);
writes something interestingly crazy.
I expected something like "int[]". So of which type is that expression, 
and is this a good way to solve numbers parsing if I suppose that input 
is correct?
Thank
    
    
More information about the Digitalmars-d-learn
mailing list