
----- Original Message ----
From: Scott McMurray <me22.ca+boost@gmail.com> To: boost@lists.boost.org Sent: Tue, March 8, 2011 3:53:38 AM Subject: Re: [boost] [xint] Boost.XInt formal review
On Mon, Mar 7, 2011 at 13:06, Artyom <artyomtnk@yahoo.com> wrote:
- Move Semantics:
boost::xint::integer a,b; a = 100; b = boost::move(a); std::cout << a<<" " <<b << std::endl; // expect 0 100, get 100, 100
integer is container and should behave like container
I think that fact should be hidden as much as possible.
What do you get from int a = 100; int b = boost::move(a);?
I'd assume 100, 100, so that result from xint is a feature, not a bug. (Though obviously relying on that fact would be a terrible idea.)
The point that same happens even for big integers, so I expect that move would prevent needless memory allocation. Finally the performance matters, so such optimizations are important. Artyom