@@ -17,6 +17,8 @@ namespace impl {
1717template <typename Value>
1818struct 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
6059struct internalPtrTag {};
@@ -67,6 +66,9 @@ template<
6766>
6867class LRUCacheContainer {
6968public:
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
149158private:
150159 using CacheItem = impl::ValueWithHook<Value>;
0 commit comments