▁break point ▁in ▁every ▁place ▁the ▁template ▁is ▁instanti ated . ▁ ▁Also , ▁because ▁the ▁compiler ▁needs ▁to ▁perform ▁macro - like ▁exp ans ions ▁of ▁templates ▁and ▁generate ▁different ▁instances ▁of ▁them ▁at ▁compile ▁time , ▁the ▁implementation ▁source ▁code ▁for ▁the ▁tem pl ated ▁class ▁or ▁function ▁must ▁be ▁available ▁( e . g . ▁included ▁in ▁a ▁header ) ▁to ▁the ▁code ▁using ▁it . ▁Tem pl ated ▁classes ▁or ▁functions , ▁including ▁much ▁of ▁the ▁Standard ▁Template ▁Library ▁( ST L ), ▁if ▁not ▁included ▁in ▁header ▁files , ▁cannot ▁be ▁compiled . ▁( This ▁is ▁in ▁contrast ▁to ▁non - tem pl ated ▁code , ▁which ▁may ▁be ▁compiled ▁to ▁binary , ▁providing ▁only ▁a ▁declarations ▁header ▁file ▁for ▁code ▁using ▁it .) ▁This ▁may ▁be ▁a ▁dis adv antage ▁by ▁expos ing ▁the ▁implementing ▁code , ▁which ▁removes ▁some ▁abstra ctions , ▁and ▁could ▁restrict ▁its ▁use ▁in ▁closed - source ▁projects . ▁ ▁Tem plates ▁in ▁D ▁ ▁The ▁D ▁programming ▁language ▁supports ▁templates ▁based ▁in ▁design ▁on ▁C ++ . ▁Most ▁C ++ ▁template ▁id i oms ▁will ▁carry ▁over ▁to ▁D ▁without ▁alter ation , ▁but ▁D ▁adds ▁some ▁additional ▁functionality : ▁▁ ▁Template ▁parameters ▁in ▁D ▁are ▁not ▁restricted ▁to ▁just ▁types ▁and ▁primitive ▁values , ▁but ▁also ▁allow ▁arbitrary ▁compile - time ▁values ▁( such ▁as ▁strings ▁and ▁struct ▁liter als ), ▁and ▁ali ases ▁to ▁arbitrary ▁ident ifiers , ▁including ▁other ▁templates ▁or ▁template ▁instanti ations . ▁ ▁Template ▁constraints