Support compiling pattern literal strings at compile-time #3404
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.
Implementation of #3384.
The PR is currently in a very early stage, so it is incomplete and will continue to be changed. Opening it as a draft to take notes, track progress, and early review.
API
For users, I currently expect the API to be
Internal
Maintainability
The code for the flag formatters remains almost unchanged. If a new flag needs to be added in the future, perhaps just add an if constexpr.
Notable Changes
All flag formatters are moved from file
pattern_formatter-inl.h
topattern_formatter.h
.consteval
impliesinline
, aconsteval
function can't be split into a definition and a declaration, therefore all flag formatters must be visible to theseconsteval
functions. However, they are still insidedetails
namespace.SPDLOG_CONSTEXPR_FUNC
has been added to the explicit constructors of all flag formatters.For some unsure concerns, TODO comments were left.
... TBD
Steps
static_pattern_formatter
.{,static_}pattern_formatter
outputs are consistent.