I am trying to implement a queue so that repeated objects can not be inserted. I have this implementation that I found but it gives me an error:
std::queue<punto> q;
std::set<std::reference_wrapper<punto>> s;
// to add:
void add(punto const & x)
{
if (s.find(x) == s.end())
{
q.push(x);
s.insert(std::ref(q.back())); // or "s.emplace(q.back());"
}
}
The s.find(x)
tells me no overloaded function instance.