11//
22// LRUStrategy.h
33//
4- // $Id: //poco/Main/Foundation/include/Poco/LRUStrategy.h#4 $
4+ // $Id: //poco/Main/Foundation/include/Poco/LRUStrategy.h#5 $
55//
66// Library: Foundation
77// Package: Cache
4747#include " Poco/Exception.h"
4848#include < list>
4949#include < map>
50+ #include < cstddef>
5051
5152
5253namespace Poco {
@@ -65,7 +66,7 @@ class LRUStrategy: public AbstractStrategy<TKey, TValue>
6566 typedef typename KeyIndex::const_iterator ConstIndexIterator;
6667
6768public:
68- LRUStrategy (size_t size):
69+ LRUStrategy (std:: size_t size):
6970 _size (size)
7071 {
7172 if (_size < 1 ) throw InvalidArgumentException (" size must be > 0" );
@@ -127,16 +128,16 @@ class LRUStrategy: public AbstractStrategy<TKey, TValue>
127128 // Note: replace only informs the cache which elements
128129 // it would like to remove!
129130 // it does not remove them on its own!
130- size_t curSize = _keyIndex.size ();
131+ std:: size_t curSize = _keyIndex.size ();
131132
132133 if (curSize < _size)
133134 {
134135 return ;
135136 }
136137
137- size_t diff = curSize - _size;
138+ std:: size_t diff = curSize - _size;
138139 Iterator it = --_keys.end (); // --keys can never be invoked on an empty list due to the minSize==1 requirement of LRU
139- size_t i = 0 ;
140+ std:: size_t i = 0 ;
140141
141142 while (i++ < diff)
142143 {
@@ -149,9 +150,9 @@ class LRUStrategy: public AbstractStrategy<TKey, TValue>
149150 }
150151
151152protected:
152- size_t _size; // / Number of keys the cache can store.
153- Keys _keys;
154- KeyIndex _keyIndex; // / For faster access to _keys
153+ std:: size_t _size; // / Number of keys the cache can store.
154+ Keys _keys;
155+ KeyIndex _keyIndex; // / For faster access to _keys
155156};
156157
157158
0 commit comments