コード例 #1
0
ファイル: main.cpp プロジェクト: zhoajianjun/QT
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;
}
コード例 #2
0
ファイル: 2策略模式.cpp プロジェクト: heyuanlong/stage
int main()  
{  
    Cache<Random_ReplaceAlgorithm> cache; //模板实参  
    cache.Replace();  
    return 0;  
}