template <template <typename, typename> class C, class T, class A >
class TTCTest
{
public:
TTCTest(C<T, A> parameter) { /* ... some stuff... */ }
C<T, A> _collection;
};
나는 T와 클래스 (각각 경로 및 할당) 특정 유형의 어디에 템플릿 만 인스턴스화되어 있는지 확인합니다. 예를 들어
:
...
list<path, allocator<path> > list1;
list<int, allocator<int> > list2;
TTCTest<list> testvar(list1); // ...should work
TTCTest<list> testvar(list2); // ...should not work
...
이 가능하며 구문은 무엇인가?
감사합니다, 골
하시기 바랍니다. – bluish
죄송합니다 - 다음에해야 할 일입니다. – ColB
C와 T가 항상 경로와 할당 자 여야 만한다면 템플릿 매개 변수 여야하는 이유는 무엇입니까? – stijn