int mainmemorycell memorycell "hello} write ) writem read"world)cout < read<end < read<end return figure program that uses memorycell class template objectprovided that object has zero-parameter constructora copy constructorand copy assignment operator notice that object is passed by constant reference alsonotice that the default parameter for the constructor is not because might not be valid object insteadthe default parameter is the result of constructing an object with its zero-parameter constructor figure shows how the memorycell can be used to store objects of both primitive and class types notice that memorycell is not classit is only class template memorycell and memorycell are the actual classes if we implement class templates as single unitthen there is very little syntax baggage many class templates arein factimplemented this way becausecurrentlyseparate compilation of templates does not work well on many platforms thereforein many casesthe entire classwith its implementationmust be placed in file popular implementations of the stl follow this strategy an alternativediscussed in appendix ais to separate the interface and implementation of the class templates this adds extra syntax and baggage and historically has been difficult for compilers to handle cleanly to avoid the extra syntax throughout this textwe providewhen necessaryin the online codeclass templates with no separation of interface and implementation in the figuresthe interface is shown as if separate compilation was usedbut the member function implementations are shown as if separate compilation was avoided this allows us to avoid focusing on syntax objectcomparableand an example in this textwe repeatedly use object and comparable as generic types object is assumed to have zero-parameter constructoran operator=and copy constructor comparableas suggested in the findmax examplehas additional functionality in the form of operatorthat can be used to provide total order some of the data structures in use operator=in addition to operatornote that for the purpose of providing total ordera== if both < and < are falsethus the use of operator=is simply for convenience