0

I saw the following code while doing some leetcode in prep for interview season:

auto select = [](const string& log)
        {
            auto index = log.find(' ') + 1;
            return ::isalpha(log[index]);
        };

what is the function of the auto select = [] more specifically the auto = [] part

interestingly, this function was able to be used as a predicate in an STL function

DanielJomaa
  • 497
  • 6
  • 21
  • look at this https://en.cppreference.com/w/cpp/language/lambda, it was useful for me – samini Aug 03 '19 at 04:09
  • [C++ meaning of \[ \]](https://stackoverflow.com/q/22327248/995714), [What does the auto c++ keyword do?](https://stackoverflow.com/q/21226402/995714) – phuclv Aug 03 '19 at 10:29

0 Answers0