Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-unique.H File Reference

Deduplicate sequential Aleph containers in-place. More...

#include <concepts>
#include <set>
#include <ah-concepts.H>
Include dependency graph for ah-unique.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Concepts

concept  Aleph::AlephSequential
 Concept for Aleph sequential containers with traversal and append semantics.
 

Functions

template<AlephSequential Container, class Compare = std::less<typename Container::Key_Type>>
requires Aleph::StrictWeakOrder<Compare, typename Container::Key_Type>
void Aleph::in_place_unique (Container &c, Compare cmp={})
 Remove duplicates in-place preserving first occurrence order.
 

Detailed Description

Deduplicate sequential Aleph containers in-place.

Provides in_place_unique, a free function that removes duplicates while preserving the first occurrence order for Aleph sequential containers (Array, DynArray, DynList, DynDlist). Complexity is O(n log n) using a std::set as the seen-set.

Definition in file ah-unique.H.