首先是一些代码,然后一些情况下,那么问题: template <typename T> using id = T;
template <template <typename...> class F, typename... T>
using apply1 = F <T...>;
template <template <typename...> class F>
struct apply
为什么我不能在函数中声明模板类型别名? #include <vector>
int main(){
//type alias deceleration:
template <typename T>
using type = std::vector<T>;
//type instantiation:
type<int> t;
}
er
考虑以下几点: template<typename X>
struct Z {};
struct A
{
using Z = ::Z<int>;
struct B : Z
{
using C = Z;
};
};
编译没有问题。尼斯。但是,现在在Z添加另一个参数: template<typename X, typename Y>