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
8.09k stars 929 forks source link

remake vector_set from inheritance from underlying container to aggre… #488

Open AntonYudintsev opened 1 year ago

AntonYudintsev commented 1 year ago

…gation

this makes it safer, as it disallows some of changes that could violate sorted contract it also saves at least sizeof(void*) on most common comparators (due to empty struct optimization in compressed_pair)

con: it explicitly requires container class to follow vector API (almost all functions are exposed in vector_set)

to consider: remove non const front(), back(), at(), [] access. Those are not safe either, left them only for compatibility

grojo-ea commented 1 year ago

Hello,

We actually have an internal change in progress (unreleased as of this writing) to reduce the size of vector_(multi)set and vector_(multi)map that I think will conflict with this change so I'm going to hold off on the PR for now.

grojo-ea commented 1 year ago

Hello again,

Version 3.21.12 (https://github.com/electronicarts/EASTL/pull/510) has the changes we had in progress that I mentioned above. Let me know if you want to try to rebase on the new version to try to get some of the API/inheritance changes reviewed or if we should close this PR instead.