Input/Logging: Make operator explicit

This fixes a long-standing todo for once we switch to C++11.
This commit is contained in:
Johanna Amann 2016-06-27 12:09:31 -07:00
parent 27a7edc0c5
commit 94e242f2fd
2 changed files with 2 additions and 8 deletions

View file

@ -42,11 +42,8 @@ public:
/**
* Returns false if the tag represents an error value rather than a
* legal reader type.
* TODO: make this conversion operator "explicit" (C++11) or use a
* "safe bool" idiom (not necessary if "explicit" is available),
* otherwise this may allow nonsense/undesired comparison operations.
*/
operator bool() const { return *this != Tag(); }
explicit operator bool() const { return *this != Tag(); }
/**
* Assignment operator.

View file

@ -42,11 +42,8 @@ public:
/**
* Returns false if the tag represents an error value rather than a
* legal writer type.
* TODO: make this conversion operator "explicit" (C++11) or use a
* "safe bool" idiom (not necessary if "explicit" is available),
* otherwise this may allow nonsense/undesired comparison operations.
*/
operator bool() const { return *this != Tag(); }
explicit operator bool() const { return *this != Tag(); }
/**
* Assignment operator.