learnbyexample@programming.dev to Linux@lemmy.mlEnglish · 2 days ago$HOME, Not So Sweet $HOMEgist.github.comexternal-linkmessage-square24fedilinkarrow-up191arrow-down16
arrow-up185arrow-down1external-link$HOME, Not So Sweet $HOMEgist.github.comlearnbyexample@programming.dev to Linux@lemmy.mlEnglish · 2 days agomessage-square24fedilink
minus-squareqaz@lemmy.worldlinkfedilinkEnglisharrow-up2·2 days agoI never understood why they added that
minus-squarebrisk@aussie.zonelinkfedilinkarrow-up6·2 days agoAmong other things it lets you define the return type in terms of the arguments to the function.
minus-squareFeyd@programming.devlinkfedilinkarrow-up3·2 days agoThey’re useful for templates because the trailing version is resolved later
minus-square_____@lemm.eelinkfedilinkEnglisharrow-up4·2 days agobecause explicitly declaring types can be redundant, if the compiler knows a lot of the times you should also know also because some types are extremely cursed: see std views/ranges
I never understood why they added that
Among other things it lets you define the return type in terms of the arguments to the function.
They’re useful for templates because the trailing version is resolved later
because explicitly declaring types can be redundant, if the compiler knows a lot of the times you should also know
also because some types are extremely cursed: see std views/ranges