
On 5/2/2010 10:28 PM, vicente.botet wrote:
In addition no information must be stored on base integer that concerns fixed_integer. This is a bad design option, IMHO.
My "HO" also is that the memory management should be separated from the arithmetic algorithms. Whether the integer is a fixed_integer or not is compile-time information, so I don't think you should be keeping runtime information to mirror that. It sounds like it was your intent for base_integer to provide the implementation of the "core" arithmetic algorithms. I would suggest moving the memory management up (or down, depending on how you view things) to the derived classes. How feasible is that? You can use CRTP to get access to the derived class's members. This probably won't affect the interface or performance any, however, so it's much more an implementation detail than COW. It's still bothering me that you're finding moving to be so much slower than COW :/ We should try to get to the bottom of this. I'll find some time today to examine the code. - Jeff