Skip to content

Noreturn functions #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NTSFka opened this issue Aug 19, 2017 · 0 comments
Open

Noreturn functions #12

NTSFka opened this issue Aug 19, 2017 · 0 comments

Comments

@NTSFka
Copy link
Contributor

NTSFka commented Aug 19, 2017

How to declare functions which never returns. Those functions are useful when function is acts as termination so it exits whole application or always throws something.

  • In C++ is [[noreturn]] attribute.
  • In Swift is Never return type.
  • In Rust is ! return type.

I don't think this is important now, but for the future version of the language. Mainly it helps the compiler to optimize code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant