El 07/09/2011 0:05, Szymon Gatner escribió:
It's moved, this feature produces the limitation (must define
copy-constructor for copyable types owning copyable and movables classes
like boost::container::vector) that Daniel has suffered. Example:
#include
#include <string>
struct template_symbol
{
template_symbol(){}
template_symbol(const template_symbol &x)
: params(x.params)
{}
template_symbol& operator=(const template_symbol &x)
{
params = x.params;
return *this;
}
boost::container::vectorstd::string params;
};
boost::container::vector func()
{
return boost::container::vector();
}
int main()
{
//RVO
boost::container::vector x (func());
//Moved
x = func();
return 0;
}
I think I'd should add this info to container documentation.
Best,
Ion