mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-09-28 03:20:44 +02:00
typos ch. 24
This commit is contained in:
parent
761a6cf8f0
commit
2f2902e3bb
4 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
C++-annotations (12.4.0 WIP)
|
||||
|
||||
* [WIP] Added the multi-index index operator, available since c++-23
|
||||
|
||||
* Typo corrections
|
||||
|
||||
|
||||
C++-annotations (12.3.1)
|
||||
|
||||
* Due to a small oversight, Debian needed a new source archive, hence the
|
||||
|
|
|
@ -85,7 +85,7 @@ The coroutine's handler class has the following characteristics:
|
|||
itt(void destroy()), hi(destroy) returning the tt(State) object's memory
|
||||
to the operating system. It ends the tt(State) object's
|
||||
existence. Usually the handler class's destructor calls
|
||||
tt(d_handle.destroy()).
|
||||
tt(d_handle.destroy());
|
||||
itt(bool done(),) hi(done) returning tt(true) when the coroutine has
|
||||
returned, and tt(false) if it's currently suspended;
|
||||
itt(coroutine_handle from_address(void *address)) hi(from_address) returns
|
||||
|
@ -93,14 +93,14 @@ The coroutine's handler class has the following characteristics:
|
|||
tt(State) object, which address is passed to the function as its
|
||||
argument. A tt(nullptr) can also be passed to tt(from_address);
|
||||
itt(explicit operator bool(),) hi(operator bool [coroutine]) returning
|
||||
tt(true) if tt(d_handle) is not a null-pointe. It's commonly used in
|
||||
tt(true) if tt(d_handle) is not a null-pointer. It's commonly used in
|
||||
the handler's destructor's tt(if (d_handle)) phrase. It returns
|
||||
tt(false) after assigning 0 (or tt(nullptr)) to tt(d_handle). This
|
||||
operator and tt(static_cast<bool>(d_handle.address())) act identically
|
||||
(note that tt(d_handle.address()) is still valid after assigning 0 to
|
||||
tt(d_handle), in which case it returns 0);
|
||||
itt(State &promise(),) hi(promise [coroutine]) returning a reference to
|
||||
the tt(Handler's State) class.
|
||||
the tt(Handler's State) class;
|
||||
itt(void resume()) hi(resume) hi(operator() [coroutine])
|
||||
(or tt(void operator()())) resumes the execution of a suspended
|
||||
coroutine. Resuming a coroutine is only defined if the coroutine is
|
||||
|
|
|
@ -43,8 +43,6 @@ coroutine is again suspended, using tt(co_yield) to pass the just read value
|
|||
on to tt(read), or (if no value could be obtained) the coroutine ends by
|
||||
calling tt(co_return). Here is the tt(Floats::coRead) coroutine:
|
||||
verbinsert(-s4 //read demo/readbinary/floats/coread.cc)
|
||||
Since tt(coRead) doesn't have to access any of tt(Float's) members it
|
||||
can be declared as a tt(static) member.
|
||||
|
||||
Likewise, the member tt(write) (re)writes the binary file, using the coroutine
|
||||
tt(coWrite), following the same procedure as used by tt(read) to obtain the
|
||||
|
|
|
@ -126,7 +126,7 @@ from the introductory section is executed. Here's tt(main) once again:
|
|||
execution by performing the statements of its tt(while (true))
|
||||
statement until again reaching its tt(co_yield) statement, as
|
||||
described above;
|
||||
it() after two iteration the tt(for)-statement ends, and just before the
|
||||
it() after two iterations the tt(for)-statement ends, and just before the
|
||||
program ends (at line 15) tt(Fibo's) destructor is automatically
|
||||
called, returning the memory allocated for the coroutine's data to the
|
||||
common pool.
|
||||
|
|
Loading…
Reference in a new issue