25 static_assert(std::is_same_v<std::decay_t<U>, T>,
"Type of value must be T");
26 auto mappedValue = mapper(value);
27 if(collection.size() < capacity){
28 cache.push_back(mappedValue);
29 collection.push_back(std::forward<U>(value));
33 for(
int i=1; i < int(capacity);i++){
40 if(mappedValue < max){
41 cache[swapIndex] = mappedValue;
42 collection[swapIndex] = std::forward<U>(value);