diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-10 21:09:41 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-11 02:24:09 +0200 |
commit | 3879bc6a4e2e322fb7ba8ab61db3c54ede6bb6a7 (patch) | |
tree | 51034ed9ca5432dfe4d891532610385301bc5362 /include/mbgl/util/vec.hpp | |
parent | c19cc4aef662e6120a0f3a93583d02989ccdd7c9 (diff) | |
download | qtlocation-mapboxgl-3879bc6a4e2e322fb7ba8ab61db3c54ede6bb6a7.tar.gz |
[core] Make vec{2,3,4} operator bool explicit
Diffstat (limited to 'include/mbgl/util/vec.hpp')
-rw-r--r-- | include/mbgl/util/vec.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/mbgl/util/vec.hpp b/include/mbgl/util/vec.hpp index a8bbd14b0f..7c91ee0ad7 100644 --- a/include/mbgl/util/vec.hpp +++ b/include/mbgl/util/vec.hpp @@ -85,12 +85,12 @@ struct vec2 { } template<typename U = T, typename std::enable_if<std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return !std::isnan(x) && !std::isnan(y); } template<typename U = T, typename std::enable_if<!std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return x != std::numeric_limits<T>::min() && y != std::numeric_limits<T>::min(); } }; @@ -107,12 +107,12 @@ struct vec3 { } template<typename U = T, typename std::enable_if<std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return !std::isnan(x) && !std::isnan(y) && !std::isnan(z); } template<typename U = T, typename std::enable_if<!std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return x != std::numeric_limits<T>::min() && y != std::numeric_limits<T>::min() && z != std::numeric_limits<T>::min(); @@ -131,12 +131,12 @@ struct vec4 { } template<typename U = T, typename std::enable_if<std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return !std::isnan(x) && !std::isnan(y) && !std::isnan(z) && !std::isnan(w); } template<typename U = T, typename std::enable_if<!std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> - inline operator bool() const { + explicit operator bool() const { return x != std::numeric_limits<T>::min() && y != std::numeric_limits<T>::min() && z != std::numeric_limits<T>::min() |