From: Maarten Kronenburg (M.Kronenburg_at_[hidden])
Date: 2006-11-28 13:18:33
"Tobias Schwinger" wrote in message
> This case is begging for templates but you avoid them at the high cost of
a weird and inflexible design.
> Why? Are you using an outdated and broken compiler? Are you afraid that
your optimized implementation might not fit in?
> If so, update and/or discover the full potential of template-based
techniques before jumping to conclusions.
> Your interface needs serious work, IMO. It's not meant offensive in any
way and I really hope you find the time and energy to pull it off.
In the book "C++ Coding Standards" by Herb Sutter and Andrei Alexandrescu,
chapter 64 reads: "Blend static and dynamic polymorphism judiciously."
In my opinion this is what I am trying to do.
In my document I have added to the section Introduction - Design Decisions
"As an unsigned, modular or allocated integer is an integer, these are
designed as (possibly template) classes derived from class integer with
virtual member functions and operators, providing runtime polymorphism. Thus
a pointer of type integer * may point to an unsigned, a modular or an
allocated integer, which all behave like an integer (virtual methods) but
with slightly different implementations. This may be compared with a driver,
which is an abstract class interface with only virtual functions. The
integer and a driver have in common that they are both very close to the
hardware. This is also the reason that for this basic type only basic
language elements are used, and not design patterns like singletons, object
factories and smart pointers, which should be used at a higher abstraction
In an earlier discussion I have mentioned that there is a scale between
compile-time (static) polymorphism on the left to run-time (dynamic)
polymorphism on the right. Then the following items can be ordered from left
containers strings integers drivers.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk