On Tue, 11 May 2010 09:14:37 -0400, Simen kjaeraas <simen.kja...@gmail.com> wrote:

Steven Schveighoffer <schvei...@yahoo.com> wrote:

But this function never gets called. I found out recently that template functions are not allowed in interfaces, which makes it impossible to use the new operator overloads on interfaces.

The problem is however, that template functions can't be virtual, and
thus can't be stuffed into interfaces. Mayhaps however, specific
instantiations could be.

Of course, implementing some kind of dynamic vtable, that could be
updated at link-time, would make many kinds of magic possible, and
might be a solution. No idea how possible this is, though.

It is planned for interfaces to be able to contain template member functions, those functions would not be virtual or overridable, and would need to be expressed completely in terms of the interface.

They are like final interface functions.

I assumed this was already done, as it was a mitigating factor when fleshing out the new operator design that you could simulate previous behavior by creating a virtual function that then was called by your template operator function.

-Steve

Reply via email to