浏览代码

fix: add const version of _size() for list

greatbridf 3 年之前
父节点
当前提交
127fbbd0af
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      include/types/list.hpp

+ 5 - 0
include/types/list.hpp

@@ -179,6 +179,11 @@ private:
     node_base_type* head;
     node_base_type* tail;
 
+    const size_t& _size(void) const noexcept
+    {
+        return (static_cast<sentry_node_type*>(head))->value;
+    }
+
     size_t& _size(void) noexcept
     {
         return (static_cast<sentry_node_type*>(head))->value;