背景
项目中需要缓存一些数据,但是淘汰算法比较差,所以使用了boost的lru_cache ,但是不满足几个需求:
没有过期时间
无法替换相同的key
完善了如上功能
代码
1 | /************************************************************************/ |
世事多变,我心中自有主见
项目中需要缓存一些数据,但是淘汰算法比较差,所以使用了boost的lru_cache ,但是不满足几个需求:
没有过期时间
无法替换相同的key
完善了如上功能
1 | /************************************************************************/ |
微信支付
支付宝