learnbyexample to [email protected]English • 2 months ago$HOME, Not So Sweet $HOMEgist.github.comexternal-linkmessage-square24fedilinkarrow-up187cross-posted to: [email protected][email protected]
arrow-up187external-link$HOME, Not So Sweet $HOMEgist.github.comlearnbyexample to [email protected]English • 2 months agomessage-square24fedilinkcross-posted to: [email protected][email protected]
minus-square@[email protected]linkfedilink6•2 months agoAmong other things it lets you define the return type in terms of the arguments to the function.
minus-square@[email protected]linkfedilinkEnglish5•2 months 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
minus-square@[email protected]linkfedilink3•2 months agoThey’re useful for templates because the trailing version is resolved later
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.
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
They’re useful for templates because the trailing version is resolved later