
----- Original Message ----- From: "DE" <satan66613@yandex.ru> To: "Chad Nelson" <boost@lists.boost.org> Sent: Saturday, May 01, 2010 6:43 PM Subject: Re: [boost] [xint] Third release is ready,requesting preliminary review
on 01.05.2010 at 2:10 Chad Nelson 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? Best, Vicente