summaryrefslogtreecommitdiff
path: root/include/mbgl/util/size.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-10-28 14:55:07 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-10-28 17:10:45 -0700
commita4c82b8a3b5e48f3bbccf32be80d45ca78d51515 (patch)
treedc5576c815a49fd310e6c599f87eac64d3f99e7d /include/mbgl/util/size.hpp
parentee3235708f5422c2737c41fca948c67ace598f4b (diff)
downloadqtlocation-mapboxgl-a4c82b8a3b5e48f3bbccf32be80d45ca78d51515.tar.gz
[core] operator bool() must always be explicit
Otherwise, it can participate in unexpected conversions. Case in point: GlyphSet::insert was comparing the result of GlyphMetrics::operator bool() where it wanted to use operator==.
Diffstat (limited to 'include/mbgl/util/size.hpp')
-rw-r--r--include/mbgl/util/size.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mbgl/util/size.hpp b/include/mbgl/util/size.hpp
index c0e2fd8180..1af85bcff5 100644
--- a/include/mbgl/util/size.hpp
+++ b/include/mbgl/util/size.hpp
@@ -13,7 +13,7 @@ public:
constexpr Size(const uint32_t width_, const uint32_t height_) : width(width_), height(height_) {
}
- constexpr operator bool() const {
+ constexpr explicit operator bool() const {
return width > 0 && height > 0;
}