▁compiler ▁de ems ▁it ▁appropriate . ▁Thus ▁both ▁function - like ▁mac ros ▁and ▁function ▁templates ▁have ▁no ▁run - time ▁overhead . ▁ ▁However , ▁templates ▁are ▁generally ▁considered ▁an ▁improvement ▁over ▁mac ros ▁for ▁these ▁purposes . ▁Tem plates ▁are ▁type - safe . ▁Tem plates ▁avoid ▁some ▁of ▁the ▁common ▁errors ▁found ▁in ▁code ▁that ▁makes ▁heavy ▁use ▁of ▁function - like ▁mac ros , ▁such ▁as ▁evalu ating ▁parameters ▁with ▁side ▁effects ▁twice . ▁Perhaps ▁most ▁important ly , ▁templates ▁were ▁designed ▁to ▁be ▁applicable ▁to ▁much ▁larger ▁problems ▁than ▁mac ros . ▁ ▁There ▁are ▁four ▁primary ▁draw back s ▁to ▁the ▁use ▁of ▁templates : ▁supported ▁features , ▁compiler ▁support , ▁poor ▁error ▁messages , ▁and ▁code ▁b loat : ▁▁ ▁Tem plates ▁in ▁C ++ ▁lack ▁many ▁features , ▁which ▁makes ▁implementing ▁them ▁and ▁using ▁them ▁in ▁a ▁straightforward ▁way ▁often ▁impossible . ▁Instead ▁program mers ▁have ▁to ▁rely ▁on ▁complicated ▁tr icks ▁which ▁leads ▁to ▁blo ated , ▁hard ▁to ▁understand ▁and ▁hard ▁to ▁maintain ▁code . ▁Current ▁develop ments ▁in ▁the ▁C ++ ▁standards ▁ex ac erb ate ▁this ▁problem ▁by ▁making ▁heavy ▁use ▁of ▁these ▁tr icks ▁and ▁building ▁a ▁lot ▁of ▁new ▁features ▁for ▁templates ▁on ▁them ▁or ▁with ▁them ▁in ▁mind . ▁ ▁Many ▁comp ilers ▁histor ically ▁have ▁poor ▁support ▁for ▁templates , ▁thus ▁the ▁use ▁of ▁templates ▁can ▁make ▁code ▁somewhat ▁less ▁port able . ▁Support ▁may ▁also ▁be ▁poor ▁when ▁a ▁C ++ ▁compiler ▁is ▁being ▁used ▁with