Am 20.09.2013 19:57, schrieb Craig Dillabaugh:
On Fri, 20 Sep 2013 06:16:03 GMT, Sönke Ludwig wrote:
Thanks. Everything works up to the last step where I get the following:
source/app.d(137): Error: template instance shapes!(map(deserializeBson!(Shape))) shapes is not a template declaration, it is a variable source/app.d(137): Error: template instance shapes!(map(deserializeBson!(Shape))) shapes is not a template declaration, it is a variable
Where line 137 is the line Shape[] ret = shapes.map!(deserializeBson!Shape).array, which I figure I should be able to fix, but I have no idea where the map!(...).array bit comes from.
Cheers,
Craig
The error message looks strange, but map()
is in std.algorithm
andarray()
in std.array
, so if any of those are not imported, maybe
that somehow causes them.
Otherwise this is the equivalent using a loop:
Shape[] ret;
foreach (bs; shapes) ret ~= deserializeBson!Shape(bs);