Flatten range of ranges

Ali Çehreli acehreli at yahoo.com
Thu May 6 09:19:27 PDT 2010


new to d wrote:
> Is there any function in phobos that does something like that:
> 
> auto a = [[1,2],[3,4]];
> assert(equals(flatten(a), [1,2,3,4]));
> 
> I am just learning D and ca't find anything like that in the docs.

How about chain:

   http://digitalmars.com/d/2.0/phobos/std_range.html#chain

Ali


More information about the Digitalmars-d-learn mailing list