소스 검색

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;