LearnFrenzy
Sign in Take a free test

Lambda Expressions · Lambda MCQ · Question 18

Capturing this through [=] in C++20 Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 18 Back to Exercise

What did C++20 change about using [=] in a member function?

  • A [=] is removed
  • B Implicitly capturing this via [=] is deprecated; write [=, this] or [=, *this] Correct
  • C [=] now copies the object
  • D Nothing
Correct Answer: Option B

[=] looked like "copy everything" but actually captured this by pointer.

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