Skip to content

constexpr / consteval version of pattern_formatter? #3384

@SpriteOvO

Description

@SpriteOvO

Since C++20, common containers (std::string, std::vector, etc.) have constexpr supports (P0784). It might be possible to provide a pattern parser for pattern_formatter that parses literal constant pattern strings at compile-time.

At least for me, most of the use cases are constant pattern strings, so the compile-time parser could avoid the performance overhead and reduce attack vectors of dynamically parsing and building pattern instances at runtime.

@gabime Would you be interested in this feature? If you would be willing to merge it, I can find time in the next month to try and make it happen. I expect this will not introduce breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions