我有一个类型如Type<Param>
。我如何检索C++ 11中的参数?模板模板类的参数
可能是类似的东西:
// I know it's not correct but it conveys the idea very well
template
<
template <class Param> class Type
>
struct GetParam
{
typedef Param Result;
};
// e.g.
typedef GetParam<std::vector<double>>::Result X; // must return double
typedef GetParam<std::list<double>>::Result X; // double
typedef GetParam<std::vector<std::list<double>>::Result X; // std::list<double>
也许看看这个答案:http://stackoverflow.com/q/213811/296460 – shuttle87