
4 Apr
2010
4 Apr
'10
9:52 p.m.
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... Best, Ion