programminga general overview separate compilation of class templates like regular classesclass templates can be implemented either entirely in their declarationsor we can separate the interface from the implementation howevercompiler support for separate compilation of templates historically has been weak and platformspecific thusin many casesthe entire class template with its implementation is placed in single header file popular implementations of the standard library follow this strategy to implement class templates appendix describes the mechanics involved in the separate compilation of templates the declaration of the interface for template is exactly what you would expectthe member functions end with single semicoloninstead of providing an implementation but as shown in appendix athe implementation of the member functions can introduce complicated-looking syntaxespecially for complicated functions like operatorworsewhen compilingthe compiler will often complain about missing functionsand avoiding this problem requires platform-specific solutions consequentlyin the online code that accompanies the textwe implement all class templates entirely in its declaration in single header file we do so because it seems to be the only way to avoid compilation problems across platforms in the textwhen illustrating the codewe provide the class interface as if separate compilation was in ordersince that is easily presentablebut implementations are shown as in the online code in platformspecific mannerone can mechanically transform our single header file implementations into separate compilation implementations if desired see appendix for some of the different scenarios that might apply using matrices several algorithms in use two-dimensional arrayswhich are popularly known as matrices the +library does not provide matrix class howevera reasonable matrix class can quickly be written the basic idea is to use vector of vectors doing this requires additional knowledge of operator overloading for the matrixwe define operator[]namelythe array-indexing operator the matrix class is given in figure the data membersconstructorand basic accessors the matrix is represented by an array data member that is declared to be vector of vector the constructor first constructs array as having rows entries each of type vector that is constructed with the zero-parameter constructor thuswe have rows zero-length vectors of object the body of the constructor is then enteredand each row is resized to have cols columns thus the constructor terminates with what appears to be two-dimensional array the numrows and numcols accessors are then easily implementedas shown