ソースを参照

feat: list::empty()

greatbridf 3 年 前
コミット
d8f7580096
1 ファイル変更6 行追加0 行削除
  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;