This question may coincide with this: Explicit specification of a template template template template template in C ++ . However, I did not find a solution in this thread.
I have a template template with a template constructor:
template<typename First, typename ... Rest> class var {
public:
template<typename T> var(T& t) {
std::cout << "general" << std::endl;
}
};
But in case this class is created using an object of the same class as the parameter (i.e. we would like to call the copy- (or move-) constructor), something concrete must be done. So I tried the following:
template<typename First, typename ... Rest> template<>
var<First, Rest...>::var(var<First, Rest...>& v) {
std::cout << "copy" << std::endl;
}
When I try to compile this with g ++ 4.6, I get the error: invalid specification explicitly before '> token Error: closing class templates are not explicitly specialized confused by earlier errors, salvation
, , ...
, , , . ?