Example #1
0
int main()
{
#if 0
    Cache cache(new LRU_ReplaceAlgorithm()); //暴露了算法的定义
    cache.Replace();
#endif
#if 0
    Cache cache(LRU); //指定标签即可
    cache.Replace();
#endif
    Cache<Random_ReplaceAlgorithm> cache; //模板实参
    cache.Replace();
    return 0;
}
Example #2
0
int main()  
{  
    Cache<Random_ReplaceAlgorithm> cache; //模板实参  
    cache.Replace();  
    return 0;  
}