Boost logo

Boost :

Subject: Re: [boost] [xint] Boost.XInt formal review
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-03-08 00:55:26


----- Original Message ----
> From: Scott McMurray <me22.ca+boost_at_[hidden]>
> To: boost_at_[hidden]
> 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_at_[hidden]> 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

      


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk