Question 6
Back to Exercise
Do auto a = []{ return 1; }; and auto b = []{ return 1; }; have the same type?
- A Yes
- B No – every lambda expression has its own unique closure type Correct
- C Only in C++20
- D Only if declared const
Correct Answer: Option B
That is why you store lambdas in auto, templates or std::function.
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!