On Mon, 15 Jun 2015 15:10:20 +0000, jmh530 wrote: you shouldn't cast it like that. use `std.array.array` to get the actual array. like this:
import std.array; auto y = x.map!(a => exp(a)).array; the thing is that `map` returns so-called "lazy range". lazy ranges trying to not do any work until they are explicitely asked. i.e. y = x.map!(a => exp(a)) doesn't do any real processing yet, it only prepares everything for it. and only when you're calling `y.front`, `map` is processing one element. only one, as it has no need to process next until you call `popFront`. tl;dr: you can't simply cast that lazy range back to array, you have to use `std.std.array` to get the array from it.
signature.asc
Description: PGP signature