[Cs3] Lambda

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Mar 1 13:30:40 EST 2023


> Hey professor, question on lambdas. Are the parameters in the () always the
> same type as what the elements are in begin range and end range ?

That depends. There is an interesting case of accumulate. See the
example we studied in class

http://antares.cs.kent.edu/~mikhail/classes/cs3/Examples/STLAlgorithms/Introduction/meanAccumulate.cpp

the first parameter of the callback could be of the arbitraray type
and the second is to be the same as the elements of the half-open
range.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list