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

> Steven Schveighoffer <schveiguy@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
May 11, 2010
bearophile wrote:

> Pelle:
>> Not yet, it's not. To compile something that's deprecated, you will need the -d switch.
>
> That's for user code marked with 'deprecated':
> http://www.digitalmars.com/d/2.0/attribute.html#deprecated
> I don't think it is designed to work with compiler/language features too.
>
> The D1 compiler has a switch (-v1), that's missing in D2, for deprecated compiler features, maybe something similar will be put back.
>
> Bye,
> bearophile

Actually the switch has nothing to do with deprecation. Originally D2 was developed and released as the same binary as D1. If you wanted to compile for version 1 you passed the -v1 switch, otherwise you were compiling version 2.

Don't ask me why the switch is still there.
1 2
Next ›   Last »