编辑代码

#include <iostream>
#include <string>
#include <memory>

using namespace std;

namespace entity {
struct AdSkuInfo {

};
}

/** LRU cache*/
template<typename KeyType, typename ValueType>
class ExpiredLruGcCache {
    public:
        ExpiredLruGcCache() {
            cout  << "ExpiredLruGcCache: key, value" << endl;
        }
        void Print() {
            cout << "This is  Base ExpiredLruGcCache" << endl;
        }
        void GetEmptyAdSkuInfo();
};

template<typename KeyType, typename ValueType>
void ExpiredLruGcCache<KeyType, ValueType>::GetEmptyAdSkuInfo() {
    std::cout << "Base   GetEmptyAdSkuInfo" << endl;
}
template<>
void ExpiredLruGcCache<int, entity::AdSkuInfo>::GetEmptyAdSkuInfo() {
    std::cout << "Special  GetEmptyAdSkuInfo" << endl;
}


int main() {
	cout << "Hello world!    - cpp.jsrun.net." << endl << endl;
    ExpiredLruGcCache<int, entity::AdSkuInfo> a;
    a.GetEmptyAdSkuInfo();

    cout << "----------------------------" << endl;

    ExpiredLruGcCache<int, std::string> b;
    b.GetEmptyAdSkuInfo();
	return 0;
}