▁That ▁means ▁that ▁an ▁alternate ▁version ▁of ▁the ▁class ▁template ▁code ▁can ▁be ▁provided ▁when ▁some ▁of ▁the ▁template ▁parameters ▁are ▁known , ▁while ▁leaving ▁other ▁template ▁parameters ▁generic . ▁This ▁can ▁be ▁used , ▁for ▁example , ▁to ▁create ▁a ▁default ▁implementation ▁( the ▁primary ▁special ization ) ▁that ▁assumes ▁that ▁copying ▁a ▁parameter izing ▁type ▁is ▁expensive ▁and ▁then ▁create ▁partial ▁special izations ▁for ▁types ▁that ▁are ▁cheap ▁to ▁copy , ▁thus ▁increasing ▁overall ▁efficiency . ▁C li ents ▁of ▁such ▁a ▁class ▁template ▁just ▁use ▁special izations ▁of ▁it ▁without ▁need ing ▁to ▁know ▁whether ▁the ▁compiler ▁used ▁the ▁primary ▁special ization ▁or ▁some ▁partial ▁special ization ▁in ▁each ▁case . ▁Class ▁templates ▁can ▁also ▁be ▁fully ▁special ized , ▁which ▁means ▁that ▁an ▁alternate ▁implementation ▁can ▁be ▁provided ▁when ▁all ▁of ▁the ▁parameter izing ▁types ▁are ▁known . ▁ ▁Adv antages ▁and ▁dis adv antages ▁Some ▁uses ▁of ▁templates , ▁such ▁as ▁the ▁max () ▁function , ▁were ▁previously ▁filled ▁by ▁function - like ▁pre processor ▁mac ros ▁( a ▁legacy ▁of ▁the ▁C ▁programming ▁language ). ▁For ▁example , ▁here ▁is ▁a ▁possible ▁max () ▁macro : ▁ ▁# define ▁max ( a , b ) ▁(( a ) ▁< ▁( b ) ▁? ▁( b ) ▁: ▁( a )) ▁ ▁Mac ros ▁are ▁expanded ▁by ▁pre processor , ▁before ▁compilation ▁proper ; ▁templates ▁are ▁expanded ▁at ▁compile ▁time . ▁Mac ros ▁are ▁always ▁expanded ▁inline ; ▁templates ▁can ▁also ▁be ▁expanded ▁as ▁inline ▁functions ▁when ▁the