Call to implicitly-deleted default constructor of ‘unordered_set< vector >‘

It’s because unordered_set is using std::hash template to compute hash for its entries and there is no std::hash for pairs. You have to define custom hash to use unordered_set.

    struct vector_hash
{
    template <class T1, class T2>
    std::size_t operator () (std::pair<T1, T2> const &v) const
    {
        return std::hash<T1>()(v.size());    
    }
};

and then declare your unordered_set as –

std::unordered_set< vector<int>, vector_hash> set;

This hash function is not good. It’s just an example.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)