2014-07-09 2 views
0

I 클래스가 : 나는 제대로 그 생성자를 쓸 수있는 방법,C++ 템플릿 클래스 생성자

filterable_data<int, char> a; 
filterable_data<int, bool> b = a; 

내 질문은 : 그 두 개의 인스턴스를 생성

template<typename T, typename S> 
class filterable_data 
{ 
    /* ... */ 
}; 

를? 그것을 너무 템플릿 제작하여

+0

당신이 시도 않았다 어디 당신이 실제로 실패 했습니까? –

답변

3

:

template<typename T2, typename S2> 
filterable_data(const filterable_data<T2, S2>& other); 
+3

OP가 원했던 것이 유용 할 수 있지만 복사 생성자가 아닙니다. 복사 생성자는 절대로 템플릿이 아닙니다. –