Hacker News new | ask | show | jobs
by cranky908canuck 75 days ago
As a user of the feature, it's the caller that needs the guaranteed elimination (and, presumably, is willing to pay for it, in syntax / compile time / run time / cognitive load). The 'zero cost feature' (only pay if used) principle seems broken if the callee has to indicate something special.

The compiler is free to do something clever (eg., two versions of fn Foo(...), one guaranteeing TCE), but as a developer merely using Foo, I don't want to have to decorate it (or, in a library, have it already decorated) to make TCE (not just TCO) possible. That requirement would constitute delving into the internals.