|
Boost : |
Subject: Re: [boost] [move] pre-review comments
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2010-04-04 17:52:56
El 03/04/2010 20:03, Jeffrey Lee Hellrung, Jr. escribió:
> template< class T >
> struct my_vector
> {
> void push_back(T& x) { /* copy x */ }
> void push_back(const rv<T>& x) { /* copy x */ }
> void push_back(rv<T>& x) { /* move x */ }
> };
I use a similar trick in current interprocess containers, which use the
other version of the move emulation (the one that does not kick
move-assignment for rvalues of copyable types. See push_back here:
http://www.boost.org/doc/libs/1_42_0/boost/interprocess/containers/container/vector.hpp
Best,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk