LearnFrenzy
Sign in Take a free test

Encapsulation · Encapsulation MCQ · Question 16

What problem does the pimpl idiom solve? Answer, explanation & discussion

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

What is the main purpose of the pimpl idiom?

  • A Faster function calls
  • B Hiding private members from the header, so changing them does not force users to recompile and the binary interface stays stable Correct
  • C Allowing multiple inheritance
  • D Avoiding constructors
Correct Answer: Option B

Private members are part of the class definition users include; pimpl moves them behind an opaque 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