virtual templated functions?

Gabriel Dos Reis
Sun Jun 11 19:50:00 GMT 2000

Tom Lien <> writes:

| I am trying to do something like this:
| class Item {
|   template<class target_iter>
|   virtual void use(target_iter begin, target_iter end) = 0;
| };
| g++ says that this is an invalid use of 'virtual' in template declaration.
| Is this a language limitation? Is it just not implemented yet? If this
| is an impossible feature is there a workaround or alternative that could
| serve my needs as well?

There is no such thing as a virtual template member function. Please,
consider asking on C++ specific forums. This list is for GCC


-- Gaby
CodeSourcery, LLC                   

More information about the Gcc mailing list