diff --git a/src/config_attribute_value.hpp b/src/config_attribute_value.hpp index 1aff629f7046..020dc39b059a 100644 --- a/src/config_attribute_value.hpp +++ b/src/config_attribute_value.hpp @@ -172,6 +172,8 @@ class config_attribute_value operator int() const { return to_int(); } operator std::string() const { return str(); } operator t_string() const { return t_str(); } + // This is to prevent int conversion being used when an attribute value is tested in an int statement + explicit operator bool() const {return to_bool(); } /// Tests for an attribute that was never set. bool blank() const;