Jelajahi Sumber

feat: list::empty()

greatbridf 3 tahun lalu
induk
melakukan
d8f7580096
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  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;