1. A class: The header file is used to hold the declaration of the class, and the implementation of the file save class is defined. 2. Detach Compilation mode: Allows you to define functions, types, class objects, and so on in a single compilation unit (. cpp file), and then reference them in another compilation unit. When the compiler finishes processing all the compilation units, the linker then processes all references to the extern symbol (sometimes by default), resulting in a single executable file. 3. Template type: The template type is not a real type, it must wait until the type is bound to determine the final type, so when instantiating a template, you must be able to let the compiler "see" where the template is used, and must see the exact definition of the template, not just their declaration, otherwise it will not be able to produce the compiled code successfully. Therefore, the standard requires that the instantiation of the template and the definition body be placed in the same compilation unit.
// Temp.htemplate <class t>class temp{public: void Set_value (const t& RT); protected : Private : <class t>void temp<t>::set_value (const t& RT) { = RT;}
C + + places the declaration and definition of a template in the same header file