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

allow tokenizing string_view to string_view(s) #15

Open
cedral opened this issue Dec 17, 2019 · 1 comment
Open

allow tokenizing string_view to string_view(s) #15

cedral opened this issue Dec 17, 2019 · 1 comment

Comments

@cedral
Copy link

cedral commented Dec 17, 2019

This requires getting around the dependency on std::string's assign function. I added the following specialization to assign_or_plus_equal to get it working but it could probably be done better.

    template<class Iterator, typename char_t>
    static void assign(Iterator b, Iterator e, std::basic_string_view<char_t>& t)
    {
        t = { std::addressof(*b), static_cast<size_t>(std::distance(b, e)) };
    }
@poyenc
Copy link

poyenc commented Aug 15, 2020

Cool! I think it's good point to start supporting basic_string_view

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

No branches or pull requests

2 participants