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

try to optimize string swapping #41

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

cor3ntin
Copy link
Owner

@cor3ntin cor3ntin commented Oct 8, 2024

No description provided.

@@ -3446,6 +3447,14 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>)
#endif
{

#if _LIBCPP_STD_VER >= 26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't do this unless the allocator is replaceable, too. (Usually it will be, but not always)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That goes to show how little i know about allocators!

@cor3ntin cor3ntin merged commit 674792c into corentin/trivially_relocatable Oct 9, 2024
8 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.

2 participants