Const template

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Tue Jan 23 22:18:22 PST 2007


Bruno Medeiros wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>>
>> * D avoids the issue of duplicated function bodies in the following way:
>>
>> struct Widget
>> {
>>   storageof(this) int* Foo(storageof(this))(int i) { ... }
>> }
>>
> 
> Hum... what if I want to override such functions? Will D even allow it?

Technically that's a template function, so you can't override it. But 
it's a template with only a few specializations, so in theory overriding 
could be made to work.

Andrei



More information about the Digitalmars-d mailing list