File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ class LRUCacheTestApp final : public nbl::application_templates::MonoSystemMonoL
185
185
{
186
186
int * destroyCounter;
187
187
188
- Foo (int * _destroyCounter) : destroyCounter(_destroyCounter) {}
188
+ Foo (int * _destroyCounter) : destroyCounter(_destroyCounter){}
189
189
190
190
void operator =(Foo&& other)
191
191
{
@@ -200,14 +200,15 @@ class LRUCacheTestApp final : public nbl::application_templates::MonoSystemMonoL
200
200
201
201
~Foo ()
202
202
{
203
+ // Only count destructions of objects resident in Cache and not ones that happen right after moving out of
203
204
if (destroyCounter)
204
205
(*destroyCounter)++;
205
206
}
206
207
};
207
208
208
209
int destroyCounter = 0 ;
209
210
{
210
- LRUCache <int , Foo> cache4 (10u );
211
+ ResizableLRUCache <int , Foo> cache4 (10u );
211
212
for (int i = 0 ; i < 10 ; i++)
212
213
cache4.insert (i, Foo (&destroyCounter));
213
214
int x = 0 ;
You can’t perform that action at this time.
0 commit comments