Преглед изворни кода

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;