I am preparing a short presentation on templates for work and am using isocpp.org as a starting point for the content. However, I have come across an interesting paragraph:
A note to the experts: I have obviously made several simplifications above. This was intentional so please don’t complain too loudly. If you know the difference between a .cpp file and a compilation unit, the difference between a class template and a template class, and the fact that templates really aren’t just glorified macros, then don’t complain: this particular question/answer wasn’t aimed at you to begin with. I simplified things so newbies would “get it,” even if doing so offends some experts.
There are a few things that confuse me, one of which is .cpp file vs compilation unit.
I have read that a single .cpp file is called a "translation unit". But what exactly is a compilation unit?
I found this answer that says translation and compilation units are the same thing, and basically just fancy names for a single .cpp file, but isocpp seems to think otherwise, and google only gives explanations for translation units even if I search "compilation unit". Wikipedia seems to mention the "Single Compilation Unit" model, but gives no insight on what actually is a compilation unit.
So what is a compilation unit and how is it different from a translation unit (and is a translation unit 100% the same thing as a .cpp file)?