view: operator bool should be explicit
Implicit bool tends to allow some unexpected behaviour when indexing with incorrect types. eg, `view<int const*> a; a["foo"];`
This commit is contained in:
parent
fdaa5e1392
commit
43f5db1cc1
2
view.hpp
2
view.hpp
@ -275,7 +275,7 @@ namespace cruft {
|
||||
|
||||
///--------------------------------------------------------------------
|
||||
/// Returns true if the view is not empty; ie, there is data remaining.
|
||||
constexpr operator bool () const noexcept
|
||||
explicit constexpr operator bool () const noexcept
|
||||
{
|
||||
return not empty ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user