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 compile-time constraints for constants #72

Merged

Conversation

mingxwa
Copy link
Collaborator

@mingxwa mingxwa commented Mar 5, 2024

Since there is no facility in the standard to tell if an expression is evaluated at compile-time (like noexcept(expr)), we used to use std::is_nothrow_constructible in the implementation of proxy. It is not equivalent to that a value could be constructed at compile-time. We did a little trick is_consteval in this change to improve the constraints. Some noexcept in the reflection types in unit tests are removed (reverted from the last PR). 2 test cases are added.

@mingxwa mingxwa marked this pull request as ready for review March 5, 2024 09:12
guominrui
guominrui previously approved these changes Mar 5, 2024
@mingxwa mingxwa requested a review from tian-lt March 5, 2024 14:01
proxy.h Show resolved Hide resolved
@tian-lt tian-lt merged commit f3cfa4b into microsoft:main Mar 6, 2024
4 checks passed
@mingxwa mingxwa deleted the user/mingxwa/improve-constant-evaluation branch March 6, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants