Skip to content

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