
8 Sep
2012
8 Sep
'12
12:30 p.m.
Am 08.09.2012 10:48, schrieb Vicente J. Botet Escriba: > 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) >> >> 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. > 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? I can't imagine that it will work. Anyway, I could store an delete-functor (calls allocator::destroy() + deallocate()) in context_base as shared_ptr does and call this delete functor from intrusive_ptr_release. Let's see if it will work. >> >> On solution could be to make coroutine non-copyable, > > Is coroutine copyable? moveable-only - I mean to derive from boost::noncopyable > >> >>> * 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? I'll take a look into the docu