Browse Source

feat: list::empty()

greatbridf 3 years ago
parent
commit
d8f7580096
1 changed files with 6 additions and 0 deletions
  1. 6 0
      include/types/list.hpp

+ 6 - 0
include/types/list.hpp

@@ -262,11 +262,17 @@ public:
     {
         return iterator_type(head->next);
     }
+
     iterator_type end() noexcept
     {
         return iterator_type(tail);
     }
 
+    bool empty(void) const noexcept
+    {
+        return size() == 0;
+    }
+
     // TODO
     // iterator_type cstart() noexcept;
     // iterator_type cend() noexcept;