-
Notifications
You must be signed in to change notification settings - Fork 104
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
add operator to convert frozen::string to std::string view (with c++17 and more) #180
base: master
Are you sure you want to change the base?
add operator to convert frozen::string to std::string view (with c++17 and more) #180
Conversation
include/frozen/string.h
Outdated
constexpr bool operator==(std::basic_string_view<chr_t> other) const { | ||
if (size_ != other.size()) | ||
return false; | ||
for (std::size_t i = 0; i < size_; ++i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use other.compare here
LGTM, with the minor extra nit in comment. Could you just add a test case that involves these two additions? thanks. |
Sorry @serge-sans-paille but we have no answer from @gvollant, have you seen tickets/PRs for you? |
@gvollant: Thanks for your recent comments after a very long time without comeback from you! Can you look others too? It is always missing:
Thanks in advance. |
@Neustradamus write on gvollant/smartversion#1 |
@serge-sans-paille I rewrote it to use the std::string_view internal compare code (which use often SIMD optimisation) |
@gvollant looks good! can you just add a test case and we're done :-) |
With this operator, it is more easy to convert
to