<分区>
为什么以下代码不起作用(使用 VS2013)?
class Test1
{
public:
template<typename T>
using my_type = T;
};
template<typename T, typename V>
class My : public T
{
public:
using t_type = T;
using my_type2 = t_type::my_type<V>;
};
int main()
{
const My<Test1, double>::my_type2 x = 5.5;
return 0;
}
Test1::my_type 会有更复杂的类型。我将是一个基于策略的类,其中 Test1 将是策略之一。 my_type2 应该成为基于策略的特定类型。并且 Test1 不能是直接采用 V 类型的模板。谢谢。