Make optional_reference bool conversion explicit
If this is non-explicit, then the following code: optional_reference<config> ref = ...; auto str = ref["key"] results in ref being converted to bool and used as an index into the key string.
This commit is contained in:
parent
a9906226a7
commit
b1b79bfd14
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return opt_.has_value();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue