Просмотр исходного кода

fix: add const version of _size() for list

greatbridf 3 лет назад
Родитель
Сommit
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;