casbin/util/array_remove_duplicates.cpp
void ArrayRemoveDuplicates(std::vector<std::string> &s) {
    std::unordered_map<std::string, bool> found;
    found.reserve(s.size());
    int j = 0;
    for (const std::string& it : s) {
        if (!found[it]) {
            found[it] = true;
            s[j++] = it;
        }
    }
    s.erase(s.begin() + j, s.end());
}
// ArrayRemoveDuplicates removes any duplicated elements in a std::string array.
ArrayRemoveDuplicates removes any duplicated elements in a std::string array.
ArrayRemoveDuplicates removes any duplicated elements in a std :: string array .
void ArrayRemoveDuplicates(std::vector<std::string> &s) {
    std::unordered_map<std::string, bool> found;
    found.reserve(s.size());
    int j = 0;
    for (const std::string& it : s) {
        if (!found[it]) {
            found[it] = true;
            s[j++] = it;
        }
    }
    s.erase(s.begin() + j, s.end());
}
void ArrayRemoveDuplicates ( std :: vector < std :: string > & s ) { std :: unordered_map < std :: string , bool > found ; found . reserve ( s . size ( ) ) ; int j = 0 ; for ( const std :: string & it : s ) { if ( ! found [ it ] ) { found [ it ] = true ; s [ j ++ ] = it ; } } s . erase ( s . begin ( ) + j , s . end ( ) ) ; }
ArrayRemoveDuplicates removes any duplicated elements in a std::string array.
ArrayRemoveDuplicates removes any duplicated elements in a std :: string array .