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 STATIC_ASSERT #167

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Commits on Oct 30, 2024

  1. 🎨 Improve STATIC_ASSERT

    Problem:
    - Writing `STATIC_ASSERT(cond, str)` means that `str` has to be formatted either
      as a separate variable or inline in the call.
    
    Solution:
    - Allow `STATIC_ASSERT(cond, fmt_str, args...)` where the string is formatted
      automatically.
    
    Notes:
    - Each argument must still be wrapped in `CX_VALUE`. Because there is no
      generic equivalent of `transform` for `__VA_ARGS__`.
    - A bug in clang (for which a workaround is in place) was discovered:
      llvm/llvm-project#114234
    - `CX_VALUE` has been made more workable with GCC. GCC did not allow the
      `struct` definition inside the macro.
    elbeno committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    884098d View commit details
    Browse the repository at this point in the history