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 semantic dosn't work with eastl::list #523

Open
SGTech87 opened this issue Oct 27, 2023 · 2 comments
Open

Move semantic dosn't work with eastl::list #523

SGTech87 opened this issue Oct 27, 2023 · 2 comments
Labels

Comments

@SGTech87
Copy link

There is a move semantic problem at the eastl::list, which is the as issue as it was with the eastl::vector:
Cannot move assign a eastl::vector<unique_ptr> #56

The solution works, but in case of different allocators an error message would be preferable.

@jhopkins-ea
Copy link
Contributor

jhopkins-ea commented Oct 30, 2023

Thanks for bringing this up and sharing the related issue.

In our internal version of EASTL I recently added tests for allocator propagation because we don't have documentation on the allocator propagation behaviour (see propagate_on_X types from AllocatorAwareContainer). EASTL doesn't have the allocator traits class and instead has the same propagation behaviour for all allocators. The results of my testing were:

  • propagate_on_container_copy_assignment::value is equivalent to the EASTL_ALLOCATOR_COPY_ENABLED macro (defaults to false).
  • propagate_on_container_move_assignment::value is always true.
  • propagate_on_container_swap::value is always true.

Of note, and directly related to your issue is that both list and slist (forward_list) have inconsistent propagation behaviour to the rest of EASTL. Additionally, basic_string also has inconsistent behaviour. Before I can submit a fix I need to do some testing to make sure that EA code is not relying on the current incorrect behaviour for those types. It may be some time before I get to that work.

@jhopkins-ea
Copy link
Contributor

jhopkins-ea commented Oct 30, 2023

For reference / visibility the reproducible example, causing compilation error, is:

eastl::list<eastl::unique_ptr<int>> l1;
eastl::list<eastl::unique_ptr<int>> l2;
l1 = eastl::move(l2);

Same for slist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants