summaryrefslogtreecommitdiff
path: root/src/mbgl/text/shaping.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 /src/mbgl/text/shaping.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 'src/mbgl/text/shaping.hpp')
-rw-r--r--src/mbgl/text/shaping.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/text/shaping.hpp b/src/mbgl/text/shaping.hpp
index cd5e8105fd..7852f710f1 100644
--- a/src/mbgl/text/shaping.hpp
+++ b/src/mbgl/text/shaping.hpp
@@ -26,7 +26,7 @@ class PositionedIcon {
float left = 0;
float right = 0;
- operator bool() const { return image && (*image).pos.hasArea(); }
+ explicit operator bool() const { return image && (*image).pos.hasArea(); }
};
PositionedIcon shapeIcon(const SpriteAtlasElement& image, const style::SymbolLayoutProperties&);