From 17a3a805f129670ff63967bfca4d46e66bfe619f Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Fri, 25 Aug 2017 10:42:14 -0700 Subject: [PATCH] [core] Add optional type template parameter to util::unit, so that it doesn't always pick up the default type of 'double' from util::mag. --- src/mbgl/util/math.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/util/math.hpp b/src/mbgl/util/math.hpp index fcde01c1a..c18ce0c25 100644 --- a/src/mbgl/util/math.hpp +++ b/src/mbgl/util/math.hpp @@ -77,9 +77,9 @@ T mag(const S& a) { return std::sqrt(a.x * a.x + a.y * a.y); } -template +template S unit(const S& a) { - auto magnitude = mag(a); + auto magnitude = mag(a); if (magnitude == 0) { return a; }