Skip to content

Commit

Permalink
Allow config_attribute_value to implicitly convert to bool in conditi…
Browse files Browse the repository at this point in the history
…onal statements
  • Loading branch information
CelticMinstrel committed Nov 1, 2019
1 parent c726eb7 commit ad6be66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config_attribute_value.hpp
Expand Up @@ -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;
Expand Down

0 comments on commit ad6be66

Please sign in to comment.