coroutine2: pull/push_type ctors with r-value ref arg

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

coroutine2: pull/push_type ctors with r-value ref arg

Boost - Users mailing list

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?

Boost-users mailing list
[hidden email]