Skip to content

✨ Add compile-time diagnostic ct_check #141

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

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Sep 24, 2024

Problem:

  • There is no way to produce a user-formatted compile-time diagnostic.

Solution:

  • Add ct_check to test a condition at compile-time and produce a ct_string
    message on failure.

Note:

  • A constraint check is the key to prevent the compiler from eliding the string.

@elbeno elbeno force-pushed the compile-time-message branch 2 times, most recently from 7d88591 to 559e0df Compare September 24, 2024 17:06
Problem:
- There is no way to produce a user-formatted compile-time diagnostic.

Solution:
- Add `ct_check` to test a condition at compile-time and produce a `ct_string`
  message on failure.

Note:
- A constraint check is the key to prevent the compiler from eliding the string.
@elbeno elbeno force-pushed the compile-time-message branch from 559e0df to 8b294fb Compare September 24, 2024 17:35
@elbeno elbeno changed the title Compile time message ✨ Add compile-time diagnostic ct_check Sep 24, 2024
Copy link
Contributor

@lukevalenty lukevalenty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! I would love it even more if I could format it in place 😅

@bdeane-intel bdeane-intel merged commit e71580e into intel:main Sep 24, 2024
31 checks passed
@elbeno elbeno deleted the compile-time-message branch September 24, 2024 19:33
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