The following code fails to compile with the following error:
Error C2923 'std::map': 'Foo::CacheEntry' is not a valid template type argument for parameter '_Ty'
Why is Foo::CacheEntry not a valid template type argument?
#include "stdafx.h"
#include <iostream>
#include <map>
#include <string>
template<int arga>
class Foo {
private:
class CacheEntry {
public:
int x;
};
static std::map<std::string, CacheEntry> cache;
};
template<int argb>
std::map<std::string, Foo<argb>::CacheEntry> Foo<argb>::cache = std::map<std::string, Foo<argb>::CacheEntry>();