LearnFrenzy
Sign in Take a free test

Lambda Expressions · Lambda MCQ · Question 8

What is a generic lambda? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 8 Back to Exercise

What is [](auto a, auto b) { return a + b; }?

  • A An error
  • B A generic lambda (C++14): its call operator is a template Correct
  • C A lambda taking std::any
  • D A variadic macro
Correct Answer: Option B

It works with ints, doubles, strings – anything supporting +.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links