mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
3904e525b0
This introduces `emplace` and `emplace_or_assign` members allowing population of the container without copying values in. It also reworks the batch insertion. On top of adding the ability to move the elements in (without making a copy) and constructing them in place, it also makes the non-assign version of the inserter a lot safer by explicitly asserting the fact that while it was in use no duplicates were added to the vector. Before now, the duplicates were just silently removed from the container. It also optimizes the batch insertion somewhat by using non-stable `std::sort` for unique case as well as replacing `std::unique` invocation with `std::find_adjacent`.