• Home
  • Raw
  • Download

Lines Matching refs:continuation

13 call/cc (call-with-current-continuation): A low-level API for stackful context
16 __callcc__ (call with current continuation) is a universal control operator
18 continuation as a first-class object and pass it as an argument to another
19 continuation.
21 A continuation (abstract concept of functional programming languages)
27 registers represent a continuation of the executed program at a given point in
31 continuation, e.g. the content of all registers.
37 current continuation (the rest of the computation; code after __cc__) and
40 convention of the ABI, of the current continuation and restoring those
41 registers of the resumed continuation. The control flow of the resumed
42 continuation continues.
43 The current continuation is suspended and passed as argument to the resumed
44 continuation.
47 `'continuation(continuation && c)'`. The parameter `c` represents the current
48 continuation from which this continuation was resumed (e.g. that has called
51 On return the __context_fn__ of the current continuation has to specify an
53 of the current continuation.
57 structure (address stored at the first stack frame) and continuation's stack is
66 __con__ represents a continuation; it contains the content of preserved
68 __con__ is a one-shot continuation - it can be used only once, after calling
76 A continuation is continued by calling `resume()`/`resume_with()`.
83 ctx::continuation source=ctx::callcc(
84 [&a](ctx::continuation && sink){
104 The continuation `sink` represents the ['main]-continuation (function `main()`).
105 `sink` is captured (current-continuation) by invoking __cc__ and passed as
108 Because the state is invalidated (one-shot continuation) by each call of
113 continuation represented by `source`. Calculated Fibonacci numbers are
129 ctx::continuation c1=callcc([&i](ctx::continuation && c2){
140 `callcc(<lambda>)` enters the lambda in continuation represented by `c1` with
142 The expression `c2.resume()` resumes the continuation `c2`.
153 in another continuation.]
157 [heading Executing function on top of a continuation]
160 continuation. For this purpose __resume_with__ has to be used.
166 ctx::continuation c=ctx::callcc([&data](ctx::continuation && c) {
181 c=c.resume_with([&data](ctx::continuation && c){
198 The expression `c.resume_with(...)` executes a lambda on top of continuation
203 Another option is to execute a function on top of the continuation that throws
208 ctx::continuation c;
209 my_exception(ctx::continuation && c_,std::string const& what) :
215 ctx::continuation c=ctx::callcc([](ctx::continuation && c) {
228 [](ctx::continuation && c){
238 continuation `c` and catched inside the `for`-loop.
244 __con__ instance (e.g. ['continuation::operator bool()] returns
276 // captured continuation
277 ctx::continuation c;
281 // create captured continuation
367 // execute parser in new continuation
368 ctx::continuation source;
374 [&is,&c,&done](ctx::continuation && sink){
378 // resume main continuation
386 // resume main continuation
446 [section Class `continuation`]
448 #include <boost/context/continuation.hpp>
450 class continuation {
452 continuation() noexcept = default;
454 ~continuation();
456 continuation(continuation && other) noexcept;
458 continuation & operator=(continuation && other) noexcept;
460 continuation(continuation const& other) noexcept = delete;
461 continuation & operator=(continuation const& other) noexcept = delete;
463 continuation resume();
466 continuation resume_with(Fn && fn);
472 bool operator==(continuation const& other) const noexcept;
474 bool operator!=(continuation const& other) const noexcept;
476 bool operator<(continuation const& other) const noexcept;
478 bool operator>(continuation const& other) const noexcept;
480 bool operator<=(continuation const& other) const noexcept;
482 bool operator>=(continuation const& other) const noexcept;
486 operator<<(std::basic_ostream<charT,traitsT> & os,continuation const& other) {
488 void swap(continuation & other) noexcept;
493 continuation() noexcept;
496 [[Effects:] [Creates a invalid continuation.]]
502 ~continuation();
505 [[Effects:] [Destructs the associated stack if `*this` is a valid continuation,
506 e.g. ['continuation::operator bool()] returns `true`.]]
512 continuation(continuation && other) noexcept;
515 [[Effects:] [Moves underlying capture continuation to `*this`.]]
521 continuation & operator=(continuation && other) noexcept;
530 continuation resume();
533 continuation resume_with(Fn && fn);
536 [[Effects:] [Captures current continuation and resumes `*this`.
539 [[Returns:] [The continuation representing the continuation that has been
541 [[Note:] [Function `fn` needs to return `continuation`.]]
542 [[Note:] [The returned continuation indicates if the suspended continuation has
551 [[Returns:] [`true` if `*this` points to a captured continuation.]]
560 [[Returns:] [`true` if `*this` does not point to a captured continuation.]]
566 bool operator==(continuation const& other) const noexcept;
569 [[Returns:] [`true` if `*this` and `other` represent the same continuation,
576 bool operator!=(continuation const& other) const noexcept;
585 bool operator<(continuation const& other) const noexcept;
589 implementation-defined total order of `continuation` values places `*this`
596 bool operator>(continuation const& other) const noexcept;
605 bool operator<=(continuation const& other) const noexcept;
614 bool operator>=(continuation const& other) const noexcept;
625 operator<<(std::basic_ostream<charT,traitsT> & os,continuation const& other);
633 [heading Call with current continuation]
635 #include <boost/context/continuation.hpp>
638 continuation callcc(Fn && fn);
641 continuation callcc(std::allocator_arg_t,StackAlloc salloc,Fn && fn);
644 continuation callcc(std::allocator_arg_t,preallocated palloc,StackAlloc salloc,Fn && fn);
647 [[Effects:] [Captures current continuation and creates a new continuation
653 [[Returns:] [The continuation representing the contexcontinuation that has been
655 [[Note:] [The returned continuation indicates if the suspended continuation has