Merged
Conversation
87cd5ae to
97c4bd9
Compare
9dae98b to
2f97d92
Compare
Problem: - It is useful to have a macro that wraps a potentially-`constexpr`-usable value in `stdx::ct` when possible, to preserve its `constexpr` properties. Solution: - Add `CT_WRAP` that does this. Notes: - See intel/compile-time-init-build#743 for some parts of this in CIB; this part probably belongs in stdx.
Problem: - It's useful to have `map`/`transform` in the preprocessor. Solution: - Add `pp_map.hpp`.
Problem: - We want to not forget to apply `CX_VALUE` to arguments in macros when they are usable at compile time. Solution: - Add `CX_WRAP` which wrap its argument in a `CX_VALUE` when it's possible to do so.
Problem:
- It's easy to call `stdx::ct_format` but forget to preserve the constexpr
nature of the arguments. Especially with literals, e.g.
`stdx::ct_format<"{}">(42)` results in a runtime format argument.
Solution:
- Add `STDX_CT_FORMAT` which automatically wraps the arguments so that their
constexpr nature is preserved where possible. `STDX_CT_FORMAT("{}", 42)` is
now a compile-time formatting operation.
mjcaisse-intel
approved these changes
Jul 10, 2025
Contributor
mjcaisse-intel
left a comment
There was a problem hiding this comment.
Awesome! Looks great. Can't wait to use this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
constexpr-usable value instdx::ctwhen possible, to preserve itsconstexprproperties.Solution:
CT_WRAPthat does this.Notes: