A member template cannot be virtual. For example:

class Shape {
  //...
  template 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 3rd Edition (Stroustrap)

+ Recent posts