Explorar o código

feat: list::empty()

greatbridf %!s(int64=3) %!d(string=hai) anos
pai
achega
d8f7580096
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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;