mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Input/Logging: Make operator explicit
This fixes a long-standing todo for once we switch to C++11.
This commit is contained in:
parent
27a7edc0c5
commit
94e242f2fd
2 changed files with 2 additions and 8 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue