0 ) ▁▁▁▁ ▁{ ▁▁▁▁▁▁▁▁ ▁R ▁r ▁= ▁R . init ; ▁▁▁▁ ▁// ▁can ▁define ▁a ▁range ▁object ▁▁▁▁▁▁▁▁ ▁if ▁( r . empty ) ▁{} ▁▁ ▁// ▁can ▁test ▁for ▁empty ▁▁▁▁▁▁▁▁ ▁r . pop Front (); ▁▁▁▁ ▁// ▁can ▁invoke ▁pop Front () ▁▁▁▁▁▁▁▁ ▁auto ▁h ▁= ▁r . front ; ▁// ▁can ▁get ▁the ▁front ▁of ▁the ▁range ▁▁▁▁ ▁} )); ▁} ▁ ▁A ▁function ▁that ▁accepts ▁only ▁input ▁ranges ▁can ▁then ▁use ▁the ▁above ▁template ▁in ▁a ▁template ▁constraint : ▁ ▁auto ▁fun ( Range )( Range ▁range ) ▁▁▁▁ ▁if ▁( is Input Range ! Range ) ▁{ ▁▁▁▁ ▁// ▁... ▁} ▁ ▁Code ▁generation ▁ ▁In ▁addition ▁to ▁template ▁met ap ro gram ming , ▁D ▁also ▁provides ▁several ▁features ▁to ▁enable ▁compile - time ▁code ▁generation : ▁▁ ▁The ▁import ▁expression ▁allows ▁reading ▁a ▁file ▁from ▁disk ▁and ▁using ▁its ▁contents ▁as ▁a ▁string ▁expression . ▁ ▁Comp ile - time ▁reflection ▁allows ▁enumer ating ▁and ▁inspect ing ▁declarations ▁and ▁their ▁members ▁during ▁compilation . ▁ ▁User - defined ▁attributes ▁allow ▁users ▁to ▁attach ▁arbitrary ▁ident ifiers ▁to ▁declarations , ▁which ▁can ▁then ▁be ▁enumer ated ▁using ▁compile - time ▁reflection . ▁ ▁Comp ile - Time ▁Function ▁Exec ution ▁( CT FE ) ▁allows ▁a ▁subset ▁of ▁D ▁( rest rict ed ▁to ▁safe ▁operations ) ▁to ▁be ▁interpreted ▁during ▁compilation . ▁ ▁String ▁mix ins ▁allow ▁evalu ating ▁and ▁compiling ▁the ▁contents ▁of ▁a ▁string ▁expression ▁as ▁D ▁code ▁that ▁becomes ▁part ▁of