Skip to content
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

Improve constexpr section #78

Closed
AnthonyCalandra opened this issue Feb 1, 2020 · 1 comment
Closed

Improve constexpr section #78

AnthonyCalandra opened this issue Feb 1, 2020 · 1 comment
Assignees

Comments

@AnthonyCalandra
Copy link
Owner

The ASM output will probably not be useful for beginners. It might be easier to think of the following example like having the expression square(2) replaced with the value 4 at compile-time.

int a = square(2);

Additionally, mention that constexpr doesn't imply that the expression is guaranteed to be evaluated at compile-time, rather, it makes it explicit that the compiler can do so.

@AnthonyCalandra
Copy link
Owner Author

0dd38f0

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