23 Mar
2017
23 Mar
'17
5:55 a.m.
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