title: Find element in a vector and remove it
body: <p>I have a vector with a set of pointers to edges in a graph. 
  I'm supposed to remove an edge but i get an error when i run this code. What i try to do is to find the index of the edge I'm looking for so i can delete the edge from the list.</p>
  
  <p>Error:</p>
  
  <pre><code>error: cannot convert '__gnu_cxx::__normal_iterator&lt;Edge**,    
  std::vector&lt;Edge*&gt; &gt;' to 'int' in initialization
     int i = find(edgeList.begin(),edgeList.end(), *e);
  </code></pre>
  
  <p>I understand it has something to do with the convertion from Edge To int, but i cant find the soloution for this.</p>
  
  <p>My method:</p>
  
  <pre><code>void Graph::removeEdge(Edge *e)
  {
  
  Node* v = e-&gt;endpoint[0];
  Node* w = e-&gt;endpoint[1];
  if (this-&gt;areAdjacent(v,w) == true)
  {
    int i = find(edgeList.begin(),edgeList.end(), *e);
  
    edgeList.erase(i)
  
   }
  }
  </code></pre>
  
  <p>Graph Class</p>
  
  <pre><code>class Graph : public GraphADT {
  
  public:
  // General graph methods
  Node* aVertex();
  void insertVertex(Node* n);
  void insertEdge(Node* v, Node* w, int i = 0);
  void removeVertex(Node* n);
  void removeEdge(Edge* e);
  std::vector&lt;Edge*&gt;&amp; incidentEdges(Node* n);
  Node** endVertices(Edge* e);
  Node* opposite(Node* n, Edge* e);
  bool areAdjacent(Node* v, Node* w);
  
  // Methods for directed edges
  bool isDirected(Edge* e);
  void insertDirectedEdge(Node* v, Node* w, int i = 0);
  Node* origin(Edge* e);
  Node* destination(Edge* e);
  
  // Generic methods
  int numVertices();
  int numEdges();
  vector&lt;Node*&gt;&amp; vertices();
  vector&lt;Edge*&gt;&amp; edges();
  
  // Algorithms
  void depthFirstTraversal(Node* n);
  void breadthFirstTraversal(Node* n);
  vector&lt;Edge*&gt; primsAlgorithm();
  void dijkstrasAlgorithm(Node* n);
  
  private:
  void setAllUnvisited();
  vector&lt;Node*&gt; verticeList;
  vector&lt;Edge*&gt; edgeList;
  };
  </code></pre>
  
  <p>Any help is much appreciated </p>