Skip to content

Commit 23894d2

Browse files
committed
fixes
1 parent 818933d commit 23894d2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

libraries/multi_index_lru/include/userver/multi_index_lru/container.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace impl {
1717
template<typename Value>
1818
struct ValueWithHook
1919
{
20+
Value value;
21+
mutable boost::intrusive::list_member_hook<> list_hook;
2022
using boost_list = boost::intrusive::list<
2123
ValueWithHook,
2224
boost::intrusive::member_hook<
@@ -52,9 +54,6 @@ struct ValueWithHook
5254
void SpliceInList(boost_list &lst) {
5355
lst.splice(lst.end(), lst, lst.iterator_to(*this));
5456
}
55-
56-
Value value;
57-
mutable boost::intrusive::list_member_hook<> list_hook;
5857
};
5958

6059
struct internalPtrTag {};
@@ -67,6 +66,9 @@ template<
6766
>
6867
class LRUCacheContainer {
6968
public:
69+
using iterator = typename Container::iterator;
70+
using const_iterator = typename Container::const_iterator;
71+
7072
explicit LRUCacheContainer(size_t max_size) : max_size(max_size) {}
7173

7274
template<typename... Args>
@@ -145,6 +147,13 @@ class LRUCacheContainer {
145147
void clear() {
146148
container.clear();
147149
}
150+
151+
iterator begin() { return container.begin(); }
152+
iterator end() { return container.end(); }
153+
const_iterator begin() const { return container.begin(); }
154+
const_iterator end() const { return container.end(); }
155+
const_iterator cbegin() const { return container.cbegin(); }
156+
const_iterator cend() const { return container.cend(); }
148157

149158
private:
150159
using CacheItem = impl::ValueWithHook<Value>;
File renamed without changes.

0 commit comments

Comments
 (0)