Boost logo

Boost :

Subject: Re: [boost] [Review.Coroutine] Some comments
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-09-07 15:07:44


most of Vicente's suggestions are done ...
(git://, branch coroutine)

Am 04.09.2012 23:06, schrieb Vicente J. Botet Escriba:
> * Could you add an standard Allocator parameter as e.g. the one of
> packaged_task?
> template <class F, class Allocator>
> explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);
boost::coroutine uses internally intrusive_ptr instead of shared_ptr -
the trick of storing the rebounded allocator as deleter in shared_ptr is
not possible (because intrusive_ptr has no such 'deleter' concept).
I would not pay for shared_ptr because it is heavy weight compared to
intrusiv_ptr (no need for atomic increment etc.). intrusive_ptr has only
the size of a pointer.

On solution could be to make coroutine non-copyable, add support for
intrusive_ptr (use-counter and **intrusive_ptr_add_ref()/
intrusive_ptr_release()). The user can decide how to allocate the
coroutine (or use boost::optional).

What do you think?

> * Parameters and move semantics. Could the signature parameters be
> rvalue references?
> R operator()(A0 a0, ..., A9 a9);
> I'm asking this because I think that Boost.Tuple has not implemented
> yet move semantics.
boost::tuple does not handle moveable-only objects - so it will not
work. we've to wiat until the supprot is added to boost::tuple.


Boost list run by bdawes at, gregod at, cpdaniel at, john at