20 Aug 2012 19:53
[fusion] move-enabled containers?
Gabriel Redner <gredner <at> gmail.com>
2012-08-20 17:53:06 GMT
2012-08-20 17:53:06 GMT
Hi folks,
I have been starting to ease into C++11, and am currently looking to
add move-awareness to some classes which have members of boost::fusion
container types. However, it seems that fusion containers are not
move-aware. For a minimal example, take the code below:
==========
#include <boost/fusion/include/vector.hpp>
#include <iostream>
class noisy
{
public:
noisy() { std::cout << "noisy()\n"; }
noisy(const noisy&) { std::cout << "noisy(const noisy&)\n"; }
noisy(noisy&&) { std::cout << "noisy(noisy&&)\n"; }
};
int main()
{
typedef boost::fusion::vector<noisy, noisy> noisyVector;
noisyVector n;
std::cout << '\n';
noisyVector n2(n);
std::cout << '\n';
noisyVector n3(std::move(n));
(Continue reading)
RSS Feed