mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
trimmed and paren-checked for 10.0.0
This commit is contained in:
parent
f269b883bf
commit
3a423f349b
12 changed files with 48 additions and 22 deletions
|
@ -35,8 +35,6 @@ IFDEF(latex)(latexcommand(
|
|||
\pagestyle{headings}
|
||||
\pagenumbering{arabic}))()
|
||||
|
||||
COMMENT( WIP THREADING
|
||||
|
||||
COMMENT( 1 )
|
||||
lchapter(Overview)(Overview Of The Chapters)
|
||||
includefile(overview)
|
||||
|
@ -113,14 +111,10 @@ COMMENT( 19 )
|
|||
lchapter(GENERIC)(The STL Generic Algorithms)
|
||||
includefile(generic)
|
||||
|
||||
END WIP THREADING)
|
||||
|
||||
COMMENT( 20 )
|
||||
lchapter(THREADING)(Multi Threading)
|
||||
includefile(threading)
|
||||
|
||||
COMMENT( WIP THREADING
|
||||
|
||||
COMMENT( 21 )
|
||||
lchapter(TEMPLATES)(Function Templates)
|
||||
includefile(functiontemplates)
|
||||
|
@ -139,4 +133,3 @@ includefile(concrete)
|
|||
|
||||
IFDEF(latex)(latexcommand(\printindex))()
|
||||
|
||||
END WIP THREADING)
|
||||
|
|
|
@ -27,5 +27,5 @@ multi-threaded programs (cf. chapter ref(THREADING)), thrown exceptions can be
|
|||
transferred between threads after converting tt(std::exception) objects to
|
||||
tt(std::exception_ptr) objects. This proceduce can even be used from inside
|
||||
the default catcher. Refer to section ref(EXCPTR) for further coverage of the
|
||||
class tt(std::exception_ptr)).
|
||||
class tt(std::exception_ptr).
|
||||
|
||||
|
|
|
@ -41,3 +41,21 @@ is possible to use enum class forward declarations.
|
|||
enum class Enum3; // Legal in C++11: default int type is used
|
||||
enum class Enum4: char; // Legal in C++11: explicitly declared type
|
||||
)
|
||||
|
||||
A sequence of symbols of a strongly typed enumeration can also be
|
||||
indicated in a tt(switch) using the i(ellipsis) syntax, as shown in the next
|
||||
example:
|
||||
verb(
|
||||
SafeEnum enumValue();
|
||||
|
||||
switch (enumValue())
|
||||
{
|
||||
case SafeEnum::NOT_OK ... SafeEnum::OK:
|
||||
cout << "Status is known\n";
|
||||
break;
|
||||
|
||||
default:
|
||||
cout << "Status unknown\n";
|
||||
break;
|
||||
}
|
||||
)
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
printf("Saw EOF\n");
|
||||
break;
|
||||
|
||||
case '0' ... '9':
|
||||
printf("Saw number character %c\n", c);
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Saw other character, hex value 0x%2x\n", c);
|
||||
}
|
||||
|
|
|
@ -73,6 +73,13 @@ the enumeration type is needed, as illustrated by the following piece of code:
|
|||
ds.setTraversal(DataStructure::BACKWARD);
|
||||
}
|
||||
)
|
||||
In the above example the constant tt(DataStructure;:FORWARD) was used to
|
||||
specify a value of an enum defined in the class tt(DataStructure). Instead of
|
||||
tt(DataStructure::FORWARD) the construction tt(ds.FORWARD) is also
|
||||
accepted. In my opinion this syntactic liberty is ugly: tt(FORWARD) is a
|
||||
symbolic value that is defined at the class level; it's not a member of tt(ds),
|
||||
which is suggested by the use of the member selector operator.
|
||||
|
||||
Only if tt(DataStructure) defines a nested class tt(Nested), in
|
||||
turn defining the enumeration tt(Traversal), the two class scopes are
|
||||
required. In that case the latter example should have been coded as follows:
|
||||
|
@ -87,3 +94,5 @@ required. In that case the latter example should have been coded as follows:
|
|||
ds.setTraversal(DataStructure::Nested::BACKWARD);
|
||||
}
|
||||
)
|
||||
Here the construction tt(DataStructure::Nested::Traversal localMode =
|
||||
ds.Nested::FORWARD) could also be used. I would avoid it.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
In this section the function template hi(async)tt(std::async) is
|
||||
covered. tt(Async) is used to start asynchronous tasks, returning values (or
|
||||
tt(void) to the calling thread, which is hard to realize merely using the
|
||||
tt(void)) to the calling thread, which is hard to realize merely using the
|
||||
tt(std::thread) class.
|
||||
|
||||
Before using the function tt(async) the tthi(future) header file must be
|
||||
|
|
|
@ -17,4 +17,3 @@ int main()
|
|||
cout << p.get_future().get() << '\n';
|
||||
}
|
||||
//=
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ int main()
|
|||
}
|
||||
}
|
||||
//=
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
This section is modified when the first or second part of the version number
|
||||
changes (and sometimes for the third part as well).
|
||||
itemization(
|
||||
it() Version 10.0.0 adds a new chapter about multi threading, which is
|
||||
formally supported since the C++11 standard. In addition some minor
|
||||
topics (e.g., tt(std::distance), some new syntax elements) were added
|
||||
to the annotations().
|
||||
it() In version 9.9.0 sections in chapter ref(STL) about specifying
|
||||
absolute and relative time were rewritten and moved to sections of
|
||||
their own. Sections about condition variablles were also rewritten.
|
||||
|
|
Loading…
Reference in a new issue