Answers to Self-Review Exercises
-
True.
False. Standard Library algorithms are not member functions. They operate indirectly on containers, through iterators.
True.
False. Standard Library algorithms do not depend on the implementation details of the containers on which they operate.
True.
False. It locates only the first value in the range for which the specified unary predicate function returns
false
.True.
-
Iterators.
random-access.
fill
,fill_n
.equal
.minmax_element
.push_back
.function object.
-
fill(items.begin(), items.end(), "hello");
generate(integers.begin(), integers.end(), nextInt);
bool result{equal(strings1.cbegin(), strings1.cend(), strings2.cbegin())};
auto newEnd remove_if(colors.begin(), colors.end(), startsWithBL); ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.