9 Feb
2018
9 Feb
'18
9:23 a.m.
Hello, push_type class have this ctor: template< typename Fn > push_type( Fn && fn) that moves the object fn, leaving it in a moved-from state. I have a vector V1<C> of class C instances that expose a public member operator: void operator()( coroutine::pull_type& source ); and I would like to construct a vector V2 of push_types, of same size, each element of V2 I construct by emplacing back a element from V1. I assume that leaves the objects in vector V1 in a moved-from state and not usable. Those objects C in V1 are needed for other purposes. Can I use those instances of C by accessing them where they've been moved to inside the elements of V2? If not, should I make a copy of V1 before populating V2? Thanks,