cosmetics

This commit is contained in:
Frank B. Brokken 2017-12-05 09:14:19 +01:00
parent 32f867c44e
commit 540ebfe056
4 changed files with 14 additions and 4 deletions

View file

@ -20,7 +20,7 @@
// options to be used by the compilers
#define COPT "-Wall -O2 -fdiagnostics-color=never -g"
#define CPPOPT "--std=c++14 -Wall -O2 -fdiagnostics-color=never -g"
#define CPPOPT "-Wall -O2 -fdiagnostics-color=never -g"
// extra library for the C++ programs
#define BOBCAT "bobcat"

View file

@ -25,7 +25,7 @@ int main()
vector<int> values = {1, 2, 3, 4, 5};
vector<string> text = {"a", "b", "c", "d", "e"};
cout << accumulate(values, lambda) << '\n' <<
cout << accumulate(values, lambda) << '\n' <<
accumulate(text, lambda) << '\n';
}
//=

View file

@ -81,3 +81,14 @@ a generic class template, which can be used as shown:
This works fine, but if you define tt(lambda) this way then you should be
prepared for complex error messages if the types of the derefenced iterators
and lambda's (silently assumed) tt(str) type don't match.
Here is a little program illustrating how generic lambda expressions can be
used in other generic lambda expressions: class templates could also have been
used. In lines 1 through 9 a generic lambda expression tt(accumulate) is
defined, defining a second paramater which is used as a function: its argument
therefore should be usable as a function. A functor definitely is, an the
second generic lambda expression tt(lambda), defined in lines 11 through 14
provides it. In line 21 tt(accumulate) and tt(lambda) are instantiated so that
they operate on (a vector of) tt(ints), in line 22 they are instantiated for
processing (a vector of) tt(strings):
verbinsert(-ns4 //code examples/genlambda2.cc)

View file

@ -130,7 +130,7 @@ The annotations() distinguishes the following categories
link(upper_bound)(UPPERBOUND);
)
it() Shufflers: performing reordering operations (i(sorting),
i(merging), i(permuting), i(shuffling), i(swapping)):
i(merging), i(permuting), i(swapping)):
quote(
link(inplace_merge)(INMERGE);
link(iter_swap)(ITERSWAP);
@ -141,7 +141,6 @@ The annotations() distinguishes the following categories
link(partial_sort_copy)(PARTSORTCP);
link(partition)(PARTIT);
link(prev_permutation)(PREVPERM);
link(random_shuffle)(SHUFFLE);
link(remove)(REMOVE);
link(remove_copy)(REMOVECP);
link(remove_copy_if)(REMOVECPIF);