Commit Graph

14 Commits

Author SHA1 Message Date
Ivan Krysak f5314e45d8 SortedVector: allow constexpr construction 2025-02-13 13:09:50 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Ivan Krysak 1f16a5bee6 KeyedObjectContainers: add erase_if 2024-06-27 11:05:50 +02:00
Ivan Krysak 6a1018b860 Remove unused linter suppressors 2024-06-27 11:05:48 +02:00
Ivan Krysak ff436f36bf SortedVector: add an iterator constructor 2024-03-18 11:02:21 +00:00
Ivan Krysak 5779cd878d KOCs: make more STL-like
This adds a couple of newer methods missing from these templates.
2023-07-02 15:06:11 +00:00
Ivan Krysak 3904e525b0 SortedVector: improve new element insertion
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`.
2023-03-15 10:19:02 +01:00
Ivan Krysak 65d1a016d4 Standardize concept naming across the codebase 2022-08-05 17:27:56 +03:00
Alessandro Di Federico d5bfb872d6 Introduce SortedVector::isSorted
This is a debug method.
2021-10-18 20:44:58 +02:00
Alessandro Di Federico 0d77258109 Introduce HasKeyObjectTraits concept 2021-05-05 17:10:12 +02:00
Alessandro Di Federico ee9f2192f3 KOC::batch_insert: return newly created object 2021-02-18 18:46:49 +01:00
Alessandro Di Federico 4982ba6922 KeyedObjectContainers: ensure serializability
This commit fixes a couple of bugs preventing SortedVector and
MutableSet from being serialized.
Also, it introduces minimal testing for serialization.
2021-01-28 17:45:14 +01:00
Massimo Fioravanti 8ba9930638 Invert inheritance of GenericGraph nodes
GenericGraphs no longer require CRTP.
2021-01-27 19:46:53 +01:00
Alessandro Di Federico 8aab914037 Import MutableSet and SortedVector
These data structures are substitutes for a `std::map<Key, Value>` where
`Key` is embedded in `Value`. Their main goal is to be serializable in a
YAML sequence while preserving the order enforced by the key.

`MutableSet` is implemented using a map.
`SortedVector` is implemented using a sorted vector.
2021-01-27 19:46:52 +01:00