The std::unique algorithm is typically used on a sorted range to produce the list of unique values.
The algorithm will operate on any forward range and will remove consecutive duplicate values.
The copy variant std::unique_copy will emit the unique values through the provided output iterator instead.
Both algorithms provide a C++17 parallel, and C++20 ranges variant.
Compiler Explorer link: https://compiler-explorer.com/z/hxa9MbxnY