
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/03/2010 01:28 PM, vicente.botet wrote:
It's not really feasible to push it to the derived classes, since it would involve a lot of duplicate code. The memory management is almost completely identical between all of the integer types, so it makes more sense to have it in a base class.
You need to mut the minimal part on the derived part, but don't add to much on the base class.
The usual way to do that is via virtual functions. I've been trying to avoid virtual functions in the base_integer class, for efficiency's sake; the intermediary class mentioned below is intended to solve the problem without need of them.
However, as I mentioned yesterday, I've found a need to separate the memory management functions from the base class anyway. I plan to move them into an intermediary class, something that inherits from base_integer, and that all the derived classes inherit from.
Ths should not solve the problem as both integer and fixed will inherit from this intermediary class.
Of course they will. That's the whole point. What *is* the problem then, that a possibly-templated intermediate class wouldn't solve it? - -- Chad Nelson Oak Circle Software, Inc. * * * -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvfDXUACgkQp9x9jeZ9/wR2EgCgjawz2DK6po8sTvr6rGJsLmht OdUAoOWue/qsa8kPNyFmZ8AN9khTGXHD =yGqC -----END PGP SIGNATURE-----