Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C++:

> All current mainstream compilers perform tail call optimisation fairly well (and have done for more than a decade)

https://stackoverflow.com/questions/34125/which-if-any-c-com... (2008)



I couldn't actually figure out whether this TCO being done "fairly well" was a guarantee or simply like Rust (I am referring to the native support of the language, not what crates allow)


When that SO answer was written, it was not a guarantee.

You can now get a guarantee by using non-standard compiler attributes:

https://clang.llvm.org/docs/AttributeReference.html#musttail

https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: