
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/01/2010 01:01 PM, vicente.botet wrote:
however so far i have a suggestion about fixed_integer for me it is counter intuitive that a fixed_integer<N> allocates memory on the heap rather than on the stack [...]
That was a tough decision. I started out with it on the heap, but there's no way to use the more-efficient swap(), operator=, or copy/move constructors that way. The best choice came down to which set of operations happens more commonly: swapping and assignment or creating a new object. I have no way of objectively measuring that for other people's code, but for my own, swapping and assignment edge out object creation, slightly.
that argument is enough for me and anyway it's _your_ decision i only make a suggestion
What about implementing both strategies, either as separated classes, or adding a template parameter?
It could be done with separated classes, but I don't see any way to do it with a template parameter; the array would have to be included in the class itself if it was ever going to be used, and I don't know of any way to eliminate it via a template parameter. - -- 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/ iEYEARECAAYFAkvcbU0ACgkQp9x9jeZ9/wRigQCg3ydTh/2cDLvWIw1RMtvc8d7Y yuoAoIAu4GaPOgNEQNvQCpYCw/IXWPGC =/3mM -----END PGP SIGNATURE-----