[Cs3] transparent functors

Mikhail Nesterenko mikhail at cs.kent.edu
Fri Feb 24 11:39:14 EST 2023


CS3,

This came up in previous lecture. As of C++14, the parameters and
return typs of predefined functors may be deduced by the compile. If
such reduction is requirested, the angle brackets are left empty. Like
so:

auto allTrue=accumulate(flags.begin(), flags.end(), true, std::logical_and<>());

priority_queue<string, std::deque<string>, std::greater<>> workWeekR;


This is the preferred style lately. I updated the algorithms slides
and examples.

thanks,
-- 
Mikhail


More information about the cs3 mailing list