[Cs3] Question about lambda in class

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Mar 19 21:53:49 EDT 2014


> In the file findIfLambda.cpp
>        auto passingScore = [](int i){return i >= 70;};
> What is the type of passingScore?
> 

passingScore is pointer to a function that returns boolean and accepts
integer as a parameter. That is, the above line can be rewritten as
follows:

   bool (*passingScore)(int) = [](int i){return i >= 70;}; 

Thanks,
--
Mikhail


More information about the cs3 mailing list