appendix separate compilation of class templates #ifndef memory_cell_h #define memory_cell_h /* class for simulating memory cell *template class memorycell publicexplicit memorycellconst object initialvalue object)const object readconstvoid writeconst object )privateobject storedvalue}#endif figure memorycell class template interface even with thisthe issue now becomes how to organize the class template declaration and the member function template definitions the main problem is that the implementations in figure are not actually functionsthey are simply templates awaiting expansion but they are not even expanded when the memorycell template is instantiated each member function template is expanded only when it is invoked everything in the header the first option is to put both the declaration and the implementation in the header file this would not work for classessince we could get multiply defined functions if several different source files had include directives that processed this headerbut since everything here is templatenot an actual classthere is no problem with this strategyit might be little easier for reading purposes to simply have the header file issue an include directive (prior to the #endifto automatically read in the implementation file with this strategythe cpp files that store the templates are not compiled directly explicit instantiation on some compilers we can achieve many of the benefits of separate compilation if we use explicit instantiation in this scenariowe set up the and cpp files as would normally