▁Standard ▁Library ▁includes ▁the ▁Standard ▁Template ▁Library ▁or ▁ST L ▁that ▁provides ▁a ▁framework ▁of ▁templates ▁for ▁common ▁data ▁structures ▁and ▁algorithms . ▁Tem plates ▁in ▁C ++ ▁may ▁also ▁be ▁used ▁for ▁template ▁met ap ro gram ming , ▁which ▁is ▁a ▁way ▁of ▁pre - evalu ating ▁some ▁of ▁the ▁code ▁at ▁compile - time ▁rather ▁than ▁run - time . ▁Using ▁template ▁special ization , ▁C ++ ▁Tem plates ▁are ▁considered ▁T uring ▁complete . ▁ ▁Techn ical ▁over view ▁There ▁are ▁two ▁kinds ▁of ▁templates : ▁function ▁templates ▁and ▁class ▁templates . ▁A ▁function ▁template ▁is ▁a ▁pattern ▁for ▁creating ▁ordinary ▁functions ▁based ▁upon ▁the ▁parameter izing ▁types ▁supplied ▁when ▁instanti ated . ▁For ▁example , ▁the ▁C ++ ▁Standard ▁Template ▁Library ▁contains ▁the ▁function ▁template ▁max ( x , ▁y ) ▁that ▁creates ▁functions ▁that ▁return ▁either ▁x ▁or ▁y , ▁wh iche ver ▁is ▁larger . ▁ ▁max () ▁could ▁be ▁defined ▁like ▁this : ▁ ▁template ▁< typename ▁T > ▁T ▁max ( T ▁x , ▁T ▁y ) ▁{ ▁▁ ▁return ▁x ▁< ▁y ▁? ▁y ▁: ▁x ; ▁} ▁ ▁Special izations ▁of ▁this ▁function ▁template , ▁instanti ations ▁with ▁specific ▁types , ▁can ▁be ▁called ▁just ▁like ▁an ▁ordinary ▁function : ▁ ▁std :: cout ▁<< ▁max ( 3 , ▁ 7 ); ▁ ▁// ▁Output s ▁ 7 . ▁ ▁The ▁compiler ▁exam ines ▁the ▁arguments ▁used ▁to ▁call ▁max ▁and ▁determ ines ▁that ▁this ▁is ▁a ▁call ▁to ▁max ( int