S
SainTiss
Hi,
Is there an extra overhead in using virtual functions and templates?
Or is is just the same overhead as with regular classes?
Either way, if you'd want to avoid it, will you always end up
with code duplication?
For example: let's say you've got two template specializations, which
differ only slightly... So you put the common behaviour in a
base class...
This is fine, but if a "common" method needs to call a "specialized" one,
it seems to me you're always going to need polymorphism...
The only way around seems to be not creating the base class, and
just copying the whole class to specialize it...
Is there a third possibility without the disadvantages of these two?
Thanks,
Hans
Is there an extra overhead in using virtual functions and templates?
Or is is just the same overhead as with regular classes?
Either way, if you'd want to avoid it, will you always end up
with code duplication?
For example: let's say you've got two template specializations, which
differ only slightly... So you put the common behaviour in a
base class...
This is fine, but if a "common" method needs to call a "specialized" one,
it seems to me you're always going to need polymorphism...
The only way around seems to be not creating the base class, and
just copying the whole class to specialize it...
Is there a third possibility without the disadvantages of these two?
Thanks,
Hans