mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-11 05:24:01 +00:00
Merge branch 'develop'
This commit is contained in:
commit
32c06ae259
@ -390,13 +390,11 @@ resumed with __push_coro_op__, __pull_coro_op__).]
|
|||||||
class coroutine<>::pull_type
|
class coroutine<>::pull_type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
pull_type() noexcept;
|
|
||||||
|
|
||||||
template< typename Fn >
|
template< typename Fn >
|
||||||
pull_type( Fn && fn, attributes const& attr = attributes() );
|
pull_type( Fn && fn);
|
||||||
|
|
||||||
template< typename Fn, typename StackAllocator >
|
template< typename StackAllocator, typename Fn >
|
||||||
pull_type( Fn && fn, attributes const& attr, StackAllocator stack_alloc);
|
pull_type( StackAllocator stack_alloc, Fn && fn);
|
||||||
|
|
||||||
pull_type( pull_type const& other)=delete;
|
pull_type( pull_type const& other)=delete;
|
||||||
|
|
||||||
@ -408,50 +406,32 @@ resumed with __push_coro_op__, __pull_coro_op__).]
|
|||||||
|
|
||||||
pull_type & operator=( pull_type && other) noexcept;
|
pull_type & operator=( pull_type && other) noexcept;
|
||||||
|
|
||||||
operator unspecified-bool-type() const noexcept;
|
pull_coroutine & operator()();
|
||||||
|
|
||||||
|
explicit operator bool() const noexcept;
|
||||||
|
|
||||||
bool operator!() const noexcept;
|
bool operator!() const noexcept;
|
||||||
|
|
||||||
void swap( pull_type & other) noexcept;
|
R get() noexcept;
|
||||||
|
|
||||||
pull_type & operator()();
|
|
||||||
|
|
||||||
R get() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template< typename R >
|
|
||||||
void swap( pull_type< R > & l, pull_type< R > & r);
|
|
||||||
|
|
||||||
template< typename R >
|
template< typename R >
|
||||||
range_iterator< pull_type< R > >::type begin( pull_type< R > &);
|
range_iterator< pull_type< R > >::type begin( pull_type< R > &);
|
||||||
|
|
||||||
template< typename R >
|
template< typename R >
|
||||||
range_iterator< pull_type< R > >::type end( pull_type< R > &);
|
range_iterator< pull_type< R > >::type end( pull_type< R > &);
|
||||||
|
|
||||||
[heading `pull_type()`]
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [Creates a coroutine representing __not_a_coro__.]]
|
|
||||||
[[Throws:] [Nothing.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading `template< typename Fn >
|
[heading `template< typename Fn >
|
||||||
pull_type( Fn && fn, attributes const& attr)`]
|
pull_type( Fn && fn)`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Preconditions:] [`size` >= minimum_stacksize(), `size` <= maximum_stacksize()
|
[[Effects:] [Creates a coroutine which will execute `fn`, and enters it.]]
|
||||||
when ! is_stack_unbounded().]]
|
|
||||||
[[Effects:] [Creates a coroutine which will execute `fn`, and enters it.
|
|
||||||
Argument `attr` determines stack clean-up and preserving floating-point
|
|
||||||
registers.]]
|
|
||||||
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `template< typename Fn, typename StackAllocator >
|
[heading `template< typename StackAllocator, typename Fn >
|
||||||
pull_type( Fn && fn, attributes const& attr, StackAllocator const& stack_alloc)`]
|
pull_type( StackAllocator const& stack_alloc, Fn && fn)`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Preconditions:] [`size` >= minimum_stacksize(), `size` <= maximum_stacksize()
|
[[Effects:] [Creates a coroutine which will execute `fn`.
|
||||||
when ! is_stack_unbounded().]]
|
|
||||||
[[Effects:] [Creates a coroutine which will execute `fn`. Argument `attr`
|
|
||||||
determines stack clean-up and preserving floating-point registers.
|
|
||||||
For allocating/deallocating the stack `stack_alloc` is used.]]
|
For allocating/deallocating the stack `stack_alloc` is used.]]
|
||||||
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
||||||
]
|
]
|
||||||
@ -475,14 +455,14 @@ internal data of `other` to `*this`. `other` becomes __not_a_coro__.]]
|
|||||||
[[Throws:] [Nothing.]]
|
[[Throws:] [Nothing.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `operator unspecified-bool-type() const`]
|
[heading `explicit operator bool() const noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
||||||
has returned (completed), the function returns `false`. Otherwise `true`.]]
|
has returned (completed), the function returns `false`. Otherwise `true`.]]
|
||||||
[[Throws:] [Nothing.]]
|
[[Throws:] [Nothing.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `bool operator!() const`]
|
[heading `bool operator!() const noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
||||||
has returned (completed), the function returns `true`. Otherwise `false`.]]
|
has returned (completed), the function returns `true`. Otherwise `false`.]]
|
||||||
@ -497,7 +477,7 @@ passed to the coroutine-function).]]
|
|||||||
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `R get()`]
|
[heading `R get() noexcept`]
|
||||||
|
|
||||||
R coroutine<R,StackAllocator>::pull_type::get();
|
R coroutine<R,StackAllocator>::pull_type::get();
|
||||||
R& coroutine<R&,StackAllocator>::pull_type::get();
|
R& coroutine<R&,StackAllocator>::pull_type::get();
|
||||||
@ -512,22 +492,6 @@ __push_coro_op__.]]
|
|||||||
the next __pull_coro_op__ call.]]
|
the next __pull_coro_op__ call.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `void swap( pull_type & other)`]
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [Swaps the internal data from `*this` with the values
|
|
||||||
of `other`.]]
|
|
||||||
[[Throws:] [Nothing.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading Non-member function `swap()`]
|
|
||||||
|
|
||||||
template< typename R >
|
|
||||||
void swap( pull_type< R > & l, pull_type< R > & r);
|
|
||||||
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [As if 'l.swap( r)'.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading Non-member function `begin( pull_type< R > &)`]
|
[heading Non-member function `begin( pull_type< R > &)`]
|
||||||
template< typename R >
|
template< typename R >
|
||||||
range_iterator< pull_type< R > >::type begin( pull_type< R > &);
|
range_iterator< pull_type< R > >::type begin( pull_type< R > &);
|
||||||
@ -559,13 +523,11 @@ would return `false`.]]
|
|||||||
class coroutine<>::push_type
|
class coroutine<>::push_type
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
push_type() noexcept;
|
|
||||||
|
|
||||||
template< typename Fn >
|
template< typename Fn >
|
||||||
push_type( Fn && fn, attributes const& attr = attributes() );
|
push_type( Fn && fn);
|
||||||
|
|
||||||
template< typename Fn, typename StackAllocator >
|
template< typename StackAllocator, typename Fn >
|
||||||
push_type( Fn && fn, attributes const& attr, StackAllocator stack_alloc);
|
push_type( StackAllocator stack_alloc, Fn && fn);
|
||||||
|
|
||||||
push_type( push_type const& other)=delete;
|
push_type( push_type const& other)=delete;
|
||||||
|
|
||||||
@ -577,46 +539,29 @@ would return `false`.]]
|
|||||||
|
|
||||||
push_type & operator=( push_type && other) noexcept;
|
push_type & operator=( push_type && other) noexcept;
|
||||||
|
|
||||||
operator unspecified-bool-type() const noexcept;
|
explicit operator bool() const noexcept;
|
||||||
|
|
||||||
bool operator!() const noexcept;
|
bool operator!() const noexcept;
|
||||||
|
|
||||||
void swap( push_type & other) noexcept;
|
|
||||||
|
|
||||||
push_type & operator()( Arg arg);
|
push_type & operator()( Arg arg);
|
||||||
};
|
};
|
||||||
|
|
||||||
template< typename Arg >
|
|
||||||
void swap( push_type< Arg > & l, push_type< Arg > & r);
|
|
||||||
|
|
||||||
template< typename Arg >
|
template< typename Arg >
|
||||||
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);
|
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);
|
||||||
|
|
||||||
template< typename Arg >
|
template< typename Arg >
|
||||||
range_iterator< push_type< Arg > >::type end( push_type< Arg > &);
|
range_iterator< push_type< Arg > >::type end( push_type< Arg > &);
|
||||||
|
|
||||||
[heading `push_type()`]
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [Creates a coroutine representing __not_a_coro__.]]
|
|
||||||
[[Throws:] [Nothing.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading `template< typename Fn >
|
[heading `template< typename Fn >
|
||||||
push_type( Fn && fn, attributes const& attr)`]
|
push_type( Fn && fn)`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Preconditions:] [`size` >= minimum_stacksize(), `size` <= maximum_stacksize()
|
[[Effects:] [Creates a coroutine which will execute `fn`.]]
|
||||||
when ! is_stack_unbounded().]]
|
|
||||||
[[Effects:] [Creates a coroutine which will execute `fn`. Argument `attr`
|
|
||||||
determines stack clean-up and preserving floating-point registers.]]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `template< typename Fn, typename StackAllocator >
|
[heading `template< typename StackAllocator, typename Fn >
|
||||||
push_type( Fn && fn, attributes const& attr, StackAllocator const& stack_alloc)`]
|
push_type( StackAllocator const& stack_alloc, Fn && fn)`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Preconditions:] [`size` >= minimum_stacksize(), `size` <= maximum_stacksize()
|
[[Effects:] [Creates a coroutine which will execute `fn`.
|
||||||
when ! is_stack_unbounded().]]
|
|
||||||
[[Effects:] [Creates a coroutine which will execute `fn`. Argument `attr`
|
|
||||||
determines stack clean-up and preserving floating-point registers.
|
|
||||||
For allocating/deallocating the stack `stack_alloc` is used.]]
|
For allocating/deallocating the stack `stack_alloc` is used.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -625,28 +570,28 @@ For allocating/deallocating the stack `stack_alloc` is used.]]
|
|||||||
[[Effects:] [Destroys the context and deallocates the stack.]]
|
[[Effects:] [Destroys the context and deallocates the stack.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `push_type( push_type && other)`]
|
[heading `push_type( push_type && other) noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Effects:] [Moves the internal data of `other` to `*this`.
|
[[Effects:] [Moves the internal data of `other` to `*this`.
|
||||||
`other` becomes __not_a_coro__.]]
|
`other` becomes __not_a_coro__.]]
|
||||||
[[Throws:] [Nothing.]]
|
[[Throws:] [Nothing.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `push_type & operator=( push_type && other)`]
|
[heading `push_type & operator=( push_type && other) noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Effects:] [Destroys the internal data of `*this` and moves the
|
[[Effects:] [Destroys the internal data of `*this` and moves the
|
||||||
internal data of `other` to `*this`. `other` becomes __not_a_coro__.]]
|
internal data of `other` to `*this`. `other` becomes __not_a_coro__.]]
|
||||||
[[Throws:] [Nothing.]]
|
[[Throws:] [Nothing.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `operator unspecified-bool-type() const`]
|
[heading `explicit operator bool() const noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
||||||
has returned (completed), the function returns `false`. Otherwise `true`.]]
|
has returned (completed), the function returns `false`. Otherwise `true`.]]
|
||||||
[[Throws:] [Nothing.]]
|
[[Throws:] [Nothing.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `bool operator!() const`]
|
[heading `bool operator!() const noexcept`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
[[Returns:] [If `*this` refers to __not_a_coro__ or the coroutine-function
|
||||||
has returned (completed), the function returns `true`. Otherwise `false`.]]
|
has returned (completed), the function returns `true`. Otherwise `false`.]]
|
||||||
@ -666,22 +611,6 @@ has returned (completed), the function returns `true`. Otherwise `false`.]]
|
|||||||
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
[[Throws:] [Exceptions thrown inside __coro_fn__.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[heading `void swap( push_type & other)`]
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [Swaps the internal data from `*this` with the values
|
|
||||||
of `other`.]]
|
|
||||||
[[Throws:] [Nothing.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading Non-member function `swap()`]
|
|
||||||
|
|
||||||
template< typename Arg >
|
|
||||||
void swap( push_type< Arg > & l, push_type< Arg > & r);
|
|
||||||
|
|
||||||
[variablelist
|
|
||||||
[[Effects:] [As if 'l.swap( r)'.]]
|
|
||||||
]
|
|
||||||
|
|
||||||
[heading Non-member function `begin( push_type< Arg > &)`]
|
[heading Non-member function `begin( push_type< Arg > &)`]
|
||||||
template< typename Arg >
|
template< typename Arg >
|
||||||
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);
|
range_iterator< push_type< Arg > >::type begin( push_type< Arg > &);
|
||||||
|
@ -49,7 +49,7 @@ pull_coroutine< T >::control_block::control_block( context::preallocated palloc,
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > ctx, T *) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > && ctx, T *) mutable {
|
||||||
// create synthesized push_coroutine< T >
|
// create synthesized push_coroutine< T >
|
||||||
typename push_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< T > synthesized{ & synthesized_cb };
|
push_coroutine< T > synthesized{ & synthesized_cb };
|
||||||
@ -78,7 +78,7 @@ pull_coroutine< T >::control_block::control_block( context::preallocated palloc,
|
|||||||
std::placeholders::_2))},
|
std::placeholders::_2))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > ctx, T *) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > && ctx, T *) mutable {
|
||||||
// create synthesized push_coroutine< T >
|
// create synthesized push_coroutine< T >
|
||||||
typename push_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< T > synthesized{ & synthesized_cb };
|
push_coroutine< T > synthesized{ & synthesized_cb };
|
||||||
@ -199,7 +199,7 @@ pull_coroutine< T & >::control_block::control_block( context::preallocated pallo
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T *> ctx, T *) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T *> && ctx, T *) mutable {
|
||||||
// create synthesized push_coroutine< T & >
|
// create synthesized push_coroutine< T & >
|
||||||
typename push_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< T & > synthesized{ & synthesized_cb };
|
push_coroutine< T & > synthesized{ & synthesized_cb };
|
||||||
@ -228,7 +228,7 @@ pull_coroutine< T & >::control_block::control_block( context::preallocated pallo
|
|||||||
std::placeholders::_2))},
|
std::placeholders::_2))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > ctx, T *) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > && ctx, T *) mutable {
|
||||||
// create synthesized push_coroutine< T & >
|
// create synthesized push_coroutine< T & >
|
||||||
typename push_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< T & > synthesized{ & synthesized_cb };
|
push_coroutine< T & > synthesized{ & synthesized_cb };
|
||||||
@ -323,7 +323,7 @@ pull_coroutine< void >::control_block::control_block( context::preallocated pall
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< void > ctx) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< void > && ctx) mutable {
|
||||||
// create synthesized push_coroutine< void >
|
// create synthesized push_coroutine< void >
|
||||||
typename push_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< void > synthesized{ & synthesized_cb };
|
push_coroutine< void > synthesized{ & synthesized_cb };
|
||||||
@ -350,7 +350,7 @@ pull_coroutine< void >::control_block::control_block( context::preallocated pall
|
|||||||
std::placeholders::_1))},
|
std::placeholders::_1))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< void > ctx) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< void > && ctx) mutable {
|
||||||
// create synthesized push_coroutine< void >
|
// create synthesized push_coroutine< void >
|
||||||
typename push_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
typename push_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
||||||
push_coroutine< void > synthesized{ & synthesized_cb };
|
push_coroutine< void > synthesized{ & synthesized_cb };
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
pull_coroutine( StackAllocator, Fn &&);
|
pull_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~pull_coroutine() noexcept;
|
~pull_coroutine();
|
||||||
|
|
||||||
pull_coroutine( pull_coroutine const&) = delete;
|
pull_coroutine( pull_coroutine const&) = delete;
|
||||||
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
||||||
@ -159,7 +159,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
pull_coroutine( StackAllocator, Fn &&);
|
pull_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~pull_coroutine() noexcept;
|
~pull_coroutine();
|
||||||
|
|
||||||
pull_coroutine( pull_coroutine const&) = delete;
|
pull_coroutine( pull_coroutine const&) = delete;
|
||||||
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
||||||
@ -269,7 +269,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
pull_coroutine( StackAllocator, Fn &&);
|
pull_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~pull_coroutine() noexcept;
|
~pull_coroutine();
|
||||||
|
|
||||||
pull_coroutine( pull_coroutine const&) = delete;
|
pull_coroutine( pull_coroutine const&) = delete;
|
||||||
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
pull_coroutine & operator=( pull_coroutine const&) = delete;
|
||||||
|
@ -59,7 +59,7 @@ pull_coroutine< T >::pull_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
pull_coroutine< T >::~pull_coroutine() noexcept {
|
pull_coroutine< T >::~pull_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ pull_coroutine< T & >::pull_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
pull_coroutine< T & >::~pull_coroutine() noexcept {
|
pull_coroutine< T & >::~pull_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ pull_coroutine< void >::pull_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
pull_coroutine< void >::~pull_coroutine() noexcept {
|
pull_coroutine< void >::~pull_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ push_coroutine< T >::control_block::control_block( context::preallocated palloc,
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > ctx, T * data) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > && ctx, T * data) mutable {
|
||||||
// create synthesized pull_coroutine< T >
|
// create synthesized pull_coroutine< T >
|
||||||
typename pull_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
typename pull_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
||||||
pull_coroutine< T > synthesized{ & synthesized_cb };
|
pull_coroutine< T > synthesized{ & synthesized_cb };
|
||||||
@ -79,7 +79,7 @@ push_coroutine< T >::control_block::control_block( context::preallocated palloc,
|
|||||||
std::placeholders::_2))},
|
std::placeholders::_2))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > ctx, T * data) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > && ctx, T * data) mutable {
|
||||||
// create synthesized pull_coroutine< T >
|
// create synthesized pull_coroutine< T >
|
||||||
typename pull_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
typename pull_coroutine< T >::control_block synthesized_cb{ this, ctx };
|
||||||
pull_coroutine< T > synthesized{ & synthesized_cb };
|
pull_coroutine< T > synthesized{ & synthesized_cb };
|
||||||
@ -178,7 +178,7 @@ push_coroutine< T & >::control_block::control_block( context::preallocated pallo
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > ctx, T * data) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< T * > && ctx, T * data) mutable {
|
||||||
// create synthesized pull_coroutine< T & >
|
// create synthesized pull_coroutine< T & >
|
||||||
typename pull_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
typename pull_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
||||||
pull_coroutine< T & > synthesized{ & synthesized_cb };
|
pull_coroutine< T & > synthesized{ & synthesized_cb };
|
||||||
@ -209,7 +209,7 @@ push_coroutine< T & >::control_block::control_block( context::preallocated pallo
|
|||||||
std::placeholders::_2))},
|
std::placeholders::_2))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > ctx, T * data) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< T * > && ctx, T * data) mutable {
|
||||||
// create synthesized pull_coroutine< T & >
|
// create synthesized pull_coroutine< T & >
|
||||||
typename pull_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
typename pull_coroutine< T & >::control_block synthesized_cb{ this, ctx };
|
||||||
pull_coroutine< T & > synthesized{ & synthesized_cb };
|
pull_coroutine< T & > synthesized{ & synthesized_cb };
|
||||||
@ -295,7 +295,7 @@ push_coroutine< void >::control_block::control_block( context::preallocated pall
|
|||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
std::move(
|
std::move(
|
||||||
std::bind(
|
std::bind(
|
||||||
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< void > ctx) mutable {
|
[this]( typename std::decay< Fn >::type & fn_, boost::context::execution_context< void > && ctx) mutable {
|
||||||
// create synthesized pull_coroutine< void >
|
// create synthesized pull_coroutine< void >
|
||||||
typename pull_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
typename pull_coroutine< void >::control_block synthesized_cb{ this, ctx };
|
||||||
pull_coroutine< void > synthesized{ & synthesized_cb };
|
pull_coroutine< void > synthesized{ & synthesized_cb };
|
||||||
@ -322,7 +322,7 @@ push_coroutine< void >::control_block::control_block( context::preallocated pall
|
|||||||
std::placeholders::_1))},
|
std::placeholders::_1))},
|
||||||
#else
|
#else
|
||||||
ctx{ std::allocator_arg, palloc, salloc,
|
ctx{ std::allocator_arg, palloc, salloc,
|
||||||
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< void > ctx) mutable {
|
[this,fn_=std::forward< Fn >( fn)]( boost::context::execution_context< void > && ctx) mutable {
|
||||||
// create synthesized pull_coroutine< void >
|
// create synthesized pull_coroutine< void >
|
||||||
typename pull_coroutine< void >::control_block synthesized_cb{ this, ctx};
|
typename pull_coroutine< void >::control_block synthesized_cb{ this, ctx};
|
||||||
pull_coroutine< void > synthesized{ & synthesized_cb };
|
pull_coroutine< void > synthesized{ & synthesized_cb };
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
push_coroutine( StackAllocator, Fn &&);
|
push_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~push_coroutine() noexcept;
|
~push_coroutine();
|
||||||
|
|
||||||
push_coroutine( push_coroutine const&) = delete;
|
push_coroutine( push_coroutine const&) = delete;
|
||||||
push_coroutine & operator=( push_coroutine const&) = delete;
|
push_coroutine & operator=( push_coroutine const&) = delete;
|
||||||
@ -125,7 +125,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
push_coroutine( StackAllocator, Fn &&);
|
push_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~push_coroutine() noexcept;
|
~push_coroutine();
|
||||||
|
|
||||||
push_coroutine( push_coroutine const&) = delete;
|
push_coroutine( push_coroutine const&) = delete;
|
||||||
push_coroutine & operator=( push_coroutine const&) = delete;
|
push_coroutine & operator=( push_coroutine const&) = delete;
|
||||||
@ -203,7 +203,7 @@ public:
|
|||||||
template< typename StackAllocator, typename Fn >
|
template< typename StackAllocator, typename Fn >
|
||||||
push_coroutine( StackAllocator, Fn &&);
|
push_coroutine( StackAllocator, Fn &&);
|
||||||
|
|
||||||
~push_coroutine() noexcept;
|
~push_coroutine();
|
||||||
|
|
||||||
push_coroutine( push_coroutine const&) = delete;
|
push_coroutine( push_coroutine const&) = delete;
|
||||||
push_coroutine & operator=( push_coroutine const&) = delete;
|
push_coroutine & operator=( push_coroutine const&) = delete;
|
||||||
|
@ -48,7 +48,7 @@ push_coroutine< T >::push_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
push_coroutine< T >::~push_coroutine() noexcept {
|
push_coroutine< T >::~push_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ push_coroutine< T & >::push_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
push_coroutine< T & >::~push_coroutine() noexcept {
|
push_coroutine< T & >::~push_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ push_coroutine< void >::push_coroutine( StackAllocator salloc, Fn && fn) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
push_coroutine< void >::~push_coroutine() noexcept {
|
push_coroutine< void >::~push_coroutine() {
|
||||||
if ( nullptr != cb_) {
|
if ( nullptr != cb_) {
|
||||||
cb_->deallocate();
|
cb_->deallocate();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user