Boost logo

Boost :

Subject: Re: [boost] [xint] Boost.XInt formal review
From: Christopher Jefferson (chris_at_[hidden])
Date: 2011-03-07 16:18:57


On 7 Mar 2011, at 21:06, Artyom wrote:
>
> Cons/Problems:
> --------------
> Points I think that are wrong:
>
> - Move Semantics:
>
> It is not clear, and not documented!
>
> boost::xint::integer a,b;
> a = 100;
> b = boost::move(a);
> // expect like swap(a,b) acts like a=b
> std::cout << a<<" " <<b << std::endl;
> // expect 0 100, get 100, 100
>
> integer is container and should behave like container
> in move context and like like a primitive type - mostly
> for optimization.

While it will take a while for people to get used to move semantics, in general you shouldn't assume anything about a moved-from value. In particular if a "small-value" optimisation is added, I would expect to see the value sometimes change, and sometimes not, for both xint::integer and std::string.

Chris


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