这是一种有效的c ++语法吗?
template<typename Var, typename T>
struct rebindVar;
template<typename Var, typename... T>
struct rebindVar<Var, std::tuple<T...> > {
typedef typename std::tuple< typename T::template rebindVar<Var>::type... > type;
};
在gcc中工作,在vs2013中不起作用。错误消息显示:
Error 1 error C3546: '...' : there are no parameter packs available to expand C:\Users\Alexandros\Desktop\project\tnnlib\src\NeuralNetwork\NeuralNetwork\Perceptron\Perceptron.h 55 1 NeuralNetwork_ut
答案 0 :(得分:2)
template <typename Var, typename T>
struct rebindOne { typedef typename T::template rebindVar<Var>::type type; };
template<typename Var, typename... T>
struct rebindVar<Var, std::tuple<T...> > {
typedef typename std::tuple< typename rebindOne<Var, T>::type... > type;
};