advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Which other techniques for reducing compilation time can you suggest? What are their tradeoffs? Tell us in the DevX C++ Forum.
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Use the Pimpl Idiom to Reduce Compilation Time and Enhance Encapsulation

Changes in the implementation details of a single infrastructure class don't have to trigger a wholesale recompilation of the numerous classes referring to the modified class. Find out how applying the Pimpl idiom can help you reduce compilation time and enhance encapsulation.  


advertisement
ong compilation time is an issue of concern for many large-scale C++ projects. In some cases, a typical build cycle takes up a whole night or an entire weekend. This problem is aggravated by the fact that changes in the implementation details of a single infrastructure class trigger a wholesale recompilation of numerous classes that refer to the modified class. This solution will show you how to apply the Pimpl idiom to reduce compile-time dependencies, and thus reduce compilation time. Another benefit of using this technique is a higher level of encapsulation.


How can you avoid a wholesale recompilation when a change in the implementation details of a frequently-used class has taken place?


Use the Pimpl idiom, also known as the compiler-firewall idiom.

  Next Page: Presenting the Problem

      Register for free to read this and other premium DevX content!

      Already Registered? Click here to Login

  • About You

  • Contact Information

  • - -      Ext: (optional)
  • Company Information




  • Create Password

Page 1: IntroductionPage 3: Apply the Pimpl Idiom
Page 2: Presenting the Problem 
advertisement