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

Move almost all view functions on best::vec and best::strbuf behind operator-> #25

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

mcy
Copy link
Owner

@mcy mcy commented Jul 15, 2024

This patch introduces best::arrow<T>, a helper for returning anything out of an operator->. The doc comment on the type explains why it exists and what C++ semantics it abuses.

best::vec and best::strbuf now have operator->s that effectively return best::span and best::str, respectively. This allows the removal of a ton of duplicated functions, and means that the owned types can't "lag" behind the unowned types! This also means that e.g. best::box<T[]> does not need to duplicate all of the functions from best::span, like to best::vec used to.

@mcy mcy changed the title Move almost all view functions on best::vec and best::strbuf behind operator->. Move almost all view functions on best::vec and best::strbuf behind operator-> Jul 15, 2024
@mcy mcy merged commit 0d52b66 into main Jul 15, 2024
3 checks passed
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