[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==.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user