equivariant functions

Christopher Wright dhasenan at gmail.com
Mon Oct 13 19:45:40 PDT 2008


Jason House wrote:
> Christopher Wright wrote:
> 
>> Jason House wrote:
>>> Templates are non-virtual right now
>> That could be changed, but it would require a lot of bookkeeping in
>> temporary files (and not object files). And it would interfere with
>> precompiled libraries.
> 
> If a template's arguments can be defined a prior, adding the functions to
> the vtable is easy.  That middle ground may be useful, but wouldn't work
> for everything.

If the range of possible arguments is not extensible, yes. You can get 
this by deferring the creation of the vtbl until after all templates 
have been instantiated. Or you can get it by analyzing the template 
parameters, but that's extremely expensive. Maybe if the parameter is an 
enum value, or based on constness of a particular type, but that's about it.

That would take a lot of development time. I hope that Walter doesn't 
choose to pursue this in the near future.



More information about the Digitalmars-d mailing list