
Le 07/09/12 21:07, Oliver Kowalke a écrit :
Hi,
most of Vicente's suggestions are done ... (git://gitorious.org/boost-dev/boost-dev.git, branch coroutine)
* 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 -
Am 04.09.2012 23:06, schrieb Vicente J. Botet Escriba: 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. I'm not suggesting that you use shared_ptr. I guess there are other means to get this work, e.g doing it explicitly in the destructor and move operations, isn't it?
On solution could be to make coroutine non-copyable,
Is coroutine 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? I don't understand what you are proposing. Anyway I think exploring the Allocator concept interface is worth the effort.
* 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.
Have you take a look at the boost::fusion::tuple move C++11 evolution? Best, Vicente