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:
Danny Robson 2020-09-24 08:05:47 +10:00
parent fdaa5e1392
commit 43f5db1cc1

View File

@ -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 ();
}