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

fix swap of eastl::list<unique_ptr[]> #559

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

virt00l
Copy link
Contributor

@virt00l virt00l commented Feb 4, 2025

...or any other type that has deleted dtor.

const this_type temp(*this); // << This would attept to call copy ctor of unique_ptr<> which is explicitly deleted
*this = x;
x     = temp;

@virt00l
Copy link
Contributor Author

virt00l commented Feb 5, 2025

Nvm, this did not fix it. WIP, please don't merge (yet)

@virt00l
Copy link
Contributor Author

virt00l commented Feb 7, 2025

Okay. Now fixed. Code like

eastl::list<eastl::unique_ptr<T>> foo, bar;
foo.swap(bar)

now compiles (but require EASTL_NAME_ENABLED being off)

…ocator

...or any other type that has deleted copy ctor.
Assume that if `allocator_type` is empty (*) then it's automatically
equal to passed instance and we can erase compile-time const assignment
branch, which is not compiles when T's copy ctor is deleted (e.g. unique_ptr)

(*) implicitly implied EASTL_NAME_ENABLED being off, since it's makes
allocator_type statefull
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