Boost logo

Boost Users :

Subject: [Boost-users] [TypeErasure] efficiency problem
From: Mikhail Strelnikov (mikhail.strelnikov_at_[hidden])
Date: 2017-03-23 05:55:15


Hello!

In following code TypeErasure creates two copies of s, while Boost.Any
creates no copies at all.

any x{ s{} };
any y{ std::move(x) };
any z;
z = std::move(y);

There is move constructor for type_erasure::any, but it does allocate
memory and calls copy constructor for s. Why?

And why there is no move assignment operator in type_erasure::any?

Thanks.

Full source: https://wandbox.org/permlink/iHs5a0bjzXsBtpwC


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net