view: add implicit bool operator for 'not empty'
This commit is contained in:
parent
01e46c7725
commit
52467c056d
9
view.hpp
9
view.hpp
@ -259,6 +259,15 @@ namespace cruft {
|
||||
return m_begin == m_end;
|
||||
}
|
||||
|
||||
|
||||
///--------------------------------------------------------------------
|
||||
/// Returns true if the view is not empty; ie, there is data remaining.
|
||||
constexpr operator bool () const noexcept
|
||||
{
|
||||
return not empty ();
|
||||
}
|
||||
|
||||
|
||||
///--------------------------------------------------------------------
|
||||
/// Returns the number of items in the view.
|
||||
constexpr auto
|
||||
|
Loading…
Reference in New Issue
Block a user