|
Boost : |
Subject: Re: [boost] [Review.Coroutine] More comments, questions and suggestions
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-09-11 06:33:28
> > It is possible to implement it but I've concerns because the
> coroutine-fn
> > has another signature/return type as the signature given to coroutine as
> > template argument. It might confuse users.
> >
> > typedef coroutine< int( int) > coro_t;
> >
> > void fn( coro_t::self_t&, int)
> > {...}
no sure - probably not, but it's not that hard to add an BOOST_STATIC_ASSERT :)
> Does the current implementation check at compile time that the return type
> of the coroutine function is the one of the signature?
>
>
>
> >> Sorry. I believed you had reached to mix them. Maybe you could reach to
> >> make a StackAllocator model a standard allocator just by renaming the
> >> stack allocator functions.
> >
> > standard-allocator requires functions like deallocate/destory
> > allocate/create.
> >
> > stack-allocators do not construct objects the allocate/deallocate only
> > memory chunks. I believe those are two different concepts (beside the
> > special requirements of stack-allocators on the return address of the
> > allocated chunk).
> >
>
> Yes. It is a bad idea to mix them. I don't remember if you plan to add
> standard allocator or not. Could you confirm?
yes - the version in my git-repo uses allocators (std::allocator as default) in coroutines ctor (beside of the stack-allocator).
regards,
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk