...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Class attributes
is used to
specify parameters required to setup a coroutine's context.
enum flag_unwind_t { stack_unwind, no_stack_unwind }; enum flag_fpu_t { fpu_preserved, fpu_not_preserved }; struct attributes { std::size_t size; flag_unwind_t do_unwind; flag_fpu_t preserve_fpu; attributes() noexcept; explicit attributes( std::size_t size_) noexcept; explicit attributes( flag_unwind_t do_unwind_) noexcept; explicit attributes( flag_fpu_t preserve_fpu_) noexcept; explicit attributes( std::size_t size_, flag_unwind_t do_unwind_) noexcept; explicit attributes( std::size_t size_, flag_fpu_t preserve_fpu_) noexcept; explicit attributes( flag_unwind_t do_unwind_, flag_fpu_t preserve_fpu_) noexcept; explicit attributes( std::size_t size_, flag_unwind_t do_unwind_, flag_fpu_t preserve_fpu_) noexcept; };
attributes()
Default constructor using boost::context::default_stacksize()
, does unwind the stack after coroutine/generator
is complete and preserves FPU registers.
Nothing.
attributes( std::size_t
size)
Argument size
defines
stack size of the new coroutine. Stack unwinding after termination and
preserving FPU registers is set by default.
Nothing.
attributes( flag_unwind_t do_unwind)
Argument do_unwind
determines
if stack will be unwound after termination or not. The default stacksize
is used for the new coroutine and FPU registers are preserved.
Nothing.
attributes( flag_fpu_t preserve_fpu)
Argument preserve_fpu
determines if FPU register have to be preserved across context switches.
The default stacksize is used for the new coroutine and its stack will
be unwound after termination.
Nothing.
attributes( std::size_t
size, flag_unwind_t do_unwind)
Arguments size
and do_unwind
are given by the user. FPU
registers are preserved across each context switch.
Nothing.
attributes( std::size_t
size, flag_fpu_t preserve_fpu)
Arguments size
and preserve_fpu
are given by the user.
The stack is automatically unwound after coroutine/generator terminates.
Nothing.
attributes( flag_unwind_t do_unwind, flag_fpu_t preserve_fpu)
Arguments do_unwind
and
preserve_fpu
are given
by the user. The stack gets a default value of boost::context::default_stacksize()
.
Nothing.
attributes( std::size_t
size, flag_unwind_t do_unwind, flag_fpu_t preserve_fpu)
Arguments size
, do_unwind
and preserve_fpu
are given by the user.
Nothing.