How to using boost::unordered_set with custom class?

  boost, c++

I’m having a hard time calling hash_value.
From this post I implemented vector<vector> object where E is a custom object.
My codes as follows:

struct E;
class myclass {
private:
     vector<E> lhs;
public:
    myclass(const vector<E>& v) :lhs{ v } {  };
    static size_t hash_value(const vector<E>& v) {
      size_t seed = 0;
      for (auto& d : v)
      {
         boost::hash_combine(seed, d.name
         boost::hash_combine(seed, d.scope););
      }
      return seed;
    }
    bool operator==(const vector<E> >& rhs) {
       for (unsigned i = 0; i < lhs.size(); i++)
         if (lhs[i].name != rhs[i].name || lhs[i].scope!= rhs[i].scope)
             return false;
       return true;
    };
};

then i call this code:

void test(std::vector<std::vector<E>>& A)
{
    boost::unordered_set < myclass > input_records(A.size());
    
    for (BOOST_AUTO(it, A.begin()); it != (A.end());) {
      auto k = input_records.insert(myclass{*it}); <<--
      ....
    }
}

however i get an error:

enter image description here

How do I fix this?

Source: Windows Questions C++

LEAVE A COMMENT