如何定义模板的类型别名的一类
问题描述:
struct Option_1
{
template<class T> using Vector = std::vector<T>;
};
我可以做
typename Option_1::Vector<int> v;
但我更喜欢以下
Vector<Option_1, int> v;
或同类者,而不单词“typename”。我定义了别名
template<class Option, class T> using Vector= typename Option::Vector<T>;
但由于无法识别模板声明/定义而失败。如何解决它?
参见:* [在哪里,为什么我必须把“模板”和“类型名”关键词?(http://*.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords)*。 – Pixelchemist