▁and ▁the ▁static ▁if ▁statement ▁provide ▁an ▁alternative ▁to ▁C ++ ' s ▁substitution ▁failure ▁is ▁not ▁an ▁error ▁( SF IN AE ) ▁mechanism , ▁similar ▁to ▁C ++ ▁concepts . ▁ ▁The ▁is (...) ▁expression ▁allows ▁spec ulative ▁instanti ation ▁to ▁verify ▁an ▁object ' s ▁tra its ▁at ▁compile ▁time . ▁ ▁The ▁auto ▁keyword ▁and ▁the ▁typeof ▁expression ▁allow ▁type ▁inference ▁for ▁variable ▁declarations ▁and ▁function ▁return ▁values , ▁which ▁in ▁turn ▁allows ▁" Vol dem ort ▁types " ▁( types ▁that ▁do ▁not ▁have ▁a ▁global ▁name ). ▁ ▁Tem plates ▁in ▁D ▁use ▁a ▁different ▁syntax ▁than ▁in ▁C ++ : ▁whereas ▁in ▁C ++ ▁template ▁parameters ▁are ▁wrapped ▁in ▁angular ▁brackets ▁( Template < param 1 , ▁param 2 > ), ▁D ▁uses ▁an ▁ex clam ation ▁sign ▁and ▁parentheses : ▁Template !( param 1 , ▁param 2 ). ▁This ▁avoid s ▁the ▁C ++ ▁parsing ▁difficulties ▁due ▁to ▁ambigu ity ▁with ▁comparison ▁operators . ▁If ▁there ▁is ▁only ▁one ▁parameter , ▁the ▁parentheses ▁can ▁be ▁omitted . ▁ ▁Convention ally , ▁D ▁comb ines ▁the ▁above ▁features ▁to ▁provide ▁compile - time ▁polym orphism ▁using ▁trait - based ▁generic ▁programming . ▁For ▁example , ▁an ▁input ▁range ▁is ▁defined ▁as ▁any ▁type ▁that ▁satisfies ▁the ▁checks ▁performed ▁by ▁is Input Range , ▁which ▁is ▁defined ▁as ▁follows : ▁ ▁template ▁is Input Range ( R ) ▁{ ▁▁▁▁ ▁enum ▁bool ▁is Input Range ▁= ▁is ( typeof ( ▁▁▁▁ ▁( in out ▁int ▁= ▁