I have always wondered why functions have to be declared inline when it is more up to the caller to declare whether to inline the contents of the function at call site.
So instead of
inline int f(int x) { return x * x; }
int main() { f(3); }
you'd want to do
int f(int x) { return x * x; }
int main() { inline f(3); }
I have seen this implemented in Zig for loops (inline for, inline while). Is there support for this in other languages?
So instead of
you'd want to do I have seen this implemented in Zig for loops (inline for, inline while). Is there support for this in other languages?