electronicarts / EASTL

EASTL stands for Electronic Arts Standard Template Library. It is an extensive and robust implementation that has an emphasis on high performance.
BSD 3-Clause "New" or "Revised" License
7.82k stars 905 forks source link

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

Open SGTech87 opened 8 months ago

SGTech87 commented 8 months ago

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 commented 8 months ago

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:

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 commented 8 months ago

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.