How can i make a function that finds an object in a set?
<p>I'm making a program that generates a maze and then uses bredth first search to find a way in the maze. My function that checks if an element is present in a container-class now uses the vector like this (where coordinatePath is a typedef for vector) :</p>

<pre><code>bool Labyrinth::inVisited(const Coordinate &amp;c, const coordinatePath &amp;visited ) const
{
    for each (Coordinate coord in visited)
    {
        if(coord == c)
            return true;
    }
    return false;
}
</code></pre>

<p>Since this method has to traverse the full container if an element is not present it's very ineffective for large searches. I tried to implement the same function that uses a set instead of a vector and wrote it like this:</p>

<pre><code>bool Labyrinth::inVisited(const Coordinate &amp;c, const set&lt;Coordinate&gt; &amp;visited ) const
{
       return (visited.find(c) != visited.end());
}
</code></pre>

<p>when i try to recomplie i get a lot of errors where the topmost is</p>

<p>Error   22  error C2676: binary '&lt;' : 'const Coordinate' does not define this operator or a conversion to a type acceptable to the predefined operator  c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef  193</p>

<p>I don't really understand these particular debug-messages and wonder if there is a way to implement this faster search!</p>
