Horje
move elements from vector to unordered_set Code Example
move elements from vector to unordered_set
#include <iostream>
#include <vector>
#include <unordered_set>
 
int main()
{
    std::vector<int> input({ 1, 2, 2, 1, 3, 1, 4 });
 
    std::unordered_set<int> set(input.begin(), input.end());
 
    for (const int &i: set) {
        std::cout << i << " ";
    }
 
    return 0;
}




Cpp

Related
how to delete an element in vector pair in cpp Code Example how to delete an element in vector pair in cpp Code Example
c++ function of find maximum value in an array Code Example c++ function of find maximum value in an array Code Example
How to turn an integer variable into a char c++ Code Example How to turn an integer variable into a char c++ Code Example
cmake g++ address sanitizer Code Example cmake g++ address sanitizer Code Example
what is the default include path in ubuntu c++ Code Example what is the default include path in ubuntu c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9