in the class: bool hasVertex(const Vertex& v) const ; bool hasVertex(const std::string& vName) const; in the Implementation: bool Graph::hasVertex(const Vertex& v) const { std::vector::iterator pos; for ( pos = vertexes.begin(); pos != vertexes.end(); pos++){ if (*pos == v); return true; } return false; } bool Graph::hasVertex(const std::string& vName) const { std::vector::iterator pos; for ( pos = vertexes.begin(); pos != vertexes.end(); pos++){ if ((*pos).getName() == vName){ return true; } } return false; }