vector: workaround internal compiler error for gcc

This commit is contained in:
Danny Robson 2014-08-01 21:39:13 +10:00
parent 8a400f7fe9
commit 233251b2c8

View File

@ -398,12 +398,12 @@ util::operator>> (const json::node &node, util::vector<S> &v) {
if (array.size () != S) if (array.size () != S)
throw std::runtime_error ("Invalid dimensionality for json-to-vector"); throw std::runtime_error ("Invalid dimensionality for json-to-vector");
std::transform (begin (array), // XXX: This used to be a std::transform but gcc 4.9.0 hit an internal
end (array), // compiler error at this point in release mode, so we dumb it down a
begin (v.data), // little.
[] (const json::node &n) { for (size_t i = 0; i < array.size (); ++i)
return n.as_number ().native (); v.data[i] = array[i].as_number ().native ();
});
return node; return node;
} }