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

String view constexpr #332

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nolange
Copy link

@nolange nolange commented Apr 22, 2020

This series makes some methods constexpr, so that you can consteval the string representations - where possible.
It also adds support for using string_views, which dont need a terminating zero after the text. This allows further consteval usage.

With this change, its now possible to consteval the c_str()
function of states during a visit_current_states.
The detail::get_type_name function is not constexpr however,
and types falling back to this, wont be consteval.
add string_view support, using the existing functions.
note that this does not pull in any headers.
this change unfortunately duplicates get_type_name,
but as string_views dont require a zero delimted string,
its now always possible to consteval a state instance.
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