Skip to content

Add constexpr attribute to operator std::basic_string_view#20

Closed
matan7890 wants to merge 1 commit intobemanproject:mainfrom
matan7890:feature/constexpr-string_view-convert-operator
Closed

Add constexpr attribute to operator std::basic_string_view#20
matan7890 wants to merge 1 commit intobemanproject:mainfrom
matan7890:feature/constexpr-string_view-convert-operator

Conversation

@matan7890
Copy link
Copy Markdown

@matan7890 matan7890 commented Mar 30, 2026

This PR makes the operator constexpr (available since C++20). While not explicitly mentioned in the RFC, there appears to be no reason to prevent compile-time usage, and this matches the behavior of similar standard library operators.

If strict adherence to P3655R2 is preferred, feel free to close this PR — I’m submitting it mainly for future reference.

Although the RFC doesn't mention it, there is no reason for this
operator to not be constexpr, at least from c++20 and later
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.

1 participant