Bienvenue sur la nouvelle documentation de CppUtils !
Fonctions & utilitaires
FUNCTIONSNamespace: CppUtils::Container::Sequence
Énumérations publiques
Section intitulée « Énumérations publiques »Difference
Section intitulée « Difference »enum class Difference { None = 0, Added, Removed, Edited};Fonctions publiques
Section intitulée « Fonctions publiques »template <Type::SizedRandomAccessRange Range0, Type::SizedRandomAccessRange Range1, class Comparator = std::ranges::equal_to, class FirstProjection = std::identity, class SecondProjection = std::identity>constexpr auto getDifferences(const Range0& list0, const Range1& list1, Comparator comparator={}, FirstProjection firstProjection={}, SecondProjection secondProjection={}) -> std::vector<Difference>;Computes element-wise differences between two random-access ranges.
Supports any random-access sized ranges (e.g. std::string, std::string_view, std::vector, std::span), optional custom element comparator, and projections for both ranges.
Voir aussi : Longest common subsequence
| Paramètre template | Description |
|---|---|
Range0 | Type of the first range (must satisfy Type::SizedRandomAccessRange). |
Range1 | Type of the second range (must satisfy Type::SizedRandomAccessRange). |
Comparator | Binary predicate comparing elements. |
FirstProjection | Projection applied to elements of the first range. |
SecondProjection | Projection applied to elements of the second range. |
| Paramètre | Description |
|---|---|
list0 | First range to compare. |
list1 | Second range to compare. |
comparator | Custom comparison predicate (defaults to std::ranges::equal_to). |
firstProjection | Projection callable for list0 (defaults to std::identity). |
secondProjection | Projection callable for list1 (defaults to std::identity). |
Retourne : Vector of Difference values detailing added, removed, or identical elements.