interval: Add empty() method

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2023-03-15 08:41:39 +01:00
parent b43b853235
commit 601cfec62d

View File

@ -45,6 +45,13 @@ namespace stdex
/// ///
inline T size() const { return start <= end ? end - start : 0; } inline T size() const { return start <= end ? end - start : 0; }
///
/// Is interval empty?
///
/// \returns true if interval is empty or false otherwise
///
inline bool empty() const { return start >= end; }
/// ///
/// Is interval valid? /// Is interval valid?
/// ///