C++ 에서 가상 템플릿 멤버함수는 지원하지 않나요???

exsider의 이미지

class A
{
    public:
        
        //  이게 필요함
        template<class T>
        virtual void func(void) = 0;

        // 나머지 기타등등...
};


class B : public A
{
    public:
        template<class T>
        void func(void) ;

        // ...
};

위와 같은 코드를 만들었더니 g++3.3에서는 컴파일이 되지 않네요.
C++에는 이런 기능은 아직 없나요???

buelgsk8er의 이미지

네 없는 것으로 압니다.
컴파일러 구현하기가 너무 어렵죠.

bugiii의 이미지

상속과 템플릿은 상화 보완적인 관계가 아닌가요?

myueho의 이미지

Quote:
A member template cannot be virtual. For example:
class Shape {
	//...
	template<class T> virtual bool intersect(const T&) const = 0; // error: virtual template
};

This must be illegal. If it were allowed, the traditional virtual function table technique for implementing virtual function could not be used. The linker would have to add a new entry to the virtual table for class Shape each time someone called intersect() with a new argument type.
The C++ Programming Language p.345