vector: add almost_equal specialisation

This commit is contained in:
Danny Robson 2015-04-02 14:57:42 +11:00
parent 3da59aea2f
commit 4aa35f4c70

View File

@ -248,3 +248,9 @@ namespace util {
template <> vector<4,double> random (void) { util::vector<4,double> out; randomise (out.data); return out; }
}
template <>
bool
almost_equal [[gnu::pure]] (const util::vector2f &a, const util::vector2f &b)
{
return std::equal (a.begin (), a.end (), b.begin (), almost_equal<float>);
}