From 233251b2c802085d74b6df1a85a2314ca8bf48b3 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 1 Aug 2014 21:39:13 +1000 Subject: [PATCH] vector: workaround internal compiler error for gcc --- vector.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vector.cpp b/vector.cpp index 1e793de3..e0aa7368 100644 --- a/vector.cpp +++ b/vector.cpp @@ -398,12 +398,12 @@ util::operator>> (const json::node &node, util::vector &v) { if (array.size () != S) throw std::runtime_error ("Invalid dimensionality for json-to-vector"); - std::transform (begin (array), - end (array), - begin (v.data), - [] (const json::node &n) { - return n.as_number ().native (); - }); + // XXX: This used to be a std::transform but gcc 4.9.0 hit an internal + // compiler error at this point in release mode, so we dumb it down a + // little. + for (size_t i = 0; i < array.size (); ++i) + v.data[i] = array[i].as_number ().native (); + return node; }