title: Compiler error using iterator: " error: ‘... ::iterator’ has no member named '...' "
body: <p>Below is the code. More relevant bits lie under Class Edge and Vertex, with the error throwing copy-constructor below the initial block. 
  I know for sure this has to do with how I'm calling end and start, seeing as how they're of type Vertex* in the Edge() class, and that I'm calling them with an iterator of type std::vector::Edge*>. It's something pointer based.
  Yes, this is for class, but it's a class project with more to it and this is just one error I've gotten stuck on. Thanks ahead of time, I'm probably just not seeing something obvious because of sleep deprivation or something. </p>
  
  <pre><code>#ifndef GRAPH_H
  #define GRAPH_H
  
  #include &lt;vector&gt;
  #include &lt;limits&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  template &lt;typename Object, typename Weight&gt;
  class graph {
  public:
  
  class Vertex;
  
  class Edge {
    public:
      Edge(Vertex* v, Vertex* w, Weight setweight) {
        start = v;
        end = w;
        v-&gt;edge.push_back(this);
        w-&gt;inedge.push_back(this);
        weight = setweight;
        explored = false;
      }
      Edge() {
        explored = false;
      }
      Weight weight;
      Vertex* start;
      Vertex* end;
      bool explored;
  };
  
  class Vertex {
    public:
      Vertex(Object setelement) {
        level = 0;
        connectedcomponent = 0;
        element = setelement;
        back = NULL;
        explored = false;
      }
      Vertex() {
        level = 0;
        connectedcomponent = 0;
        back = NULL;
        explored = false;
      }
      Object element;
      vector&lt;Edge*&gt; edge;
      vector&lt;Edge*&gt; inedge;
      double value;
      size_t starttime, finishtime;
      size_t level;
      size_t connectedcomponent;
      float rank;
      Vertex* back;
      int color;
      bool explored;
  };
  
  private:
  
  vector&lt;Edge*&gt; edge;
  
  vector&lt;Vertex*&gt; vertex;
  
  size_t counter;
  
  public:
  graph();
  
  graph(graph&amp; G);
  
  ~graph();
  
  void reset();
  void resetBack();
  void resetValues();
  void resetLevels();
  void resetExplored();
  void resetConnectedComponents();
  vector&lt;Vertex*&gt; incidentVertices(Vertex* v);
  vector&lt;Edge*&gt; incidentEdges(Vertex* v);
  vector&lt;Edge*&gt; outgoingEdges(Vertex* v);
  vector&lt;Vertex*&gt; adjacentVertices(Vertex* v);
  size_t indegree(Vertex* v);
  size_t outdegree(Vertex* v);
  size_t degree(Vertex* v);
  Vertex* startVertex(Edge* e);
  Vertex* endVertex(Edge* e);
  
  bool isAdjacent(Vertex* v, Vertex* w);
  
  Vertex* insertVertex(Object o);
  void insertEdge(Vertex* v, Vertex* w, Weight t);
  void insertUndirectedEdge(Vertex* v, Vertex* w, Weight t);
  void removeVertex(Vertex* v);
  void removeEdge(Edge* e);
  
  size_t numVertices();
  size_t numEdges();
  vector&lt;Vertex*&gt; vertices();
  vector&lt;Edge*&gt; edges();
  
  void print();
  void read_file(std::string filename);
  };
  
  template &lt;typename Object, typename Weight&gt;
  graph&lt;Object, Weight&gt;::graph() {//Default Constructor
      Edge();
      Vertex();
      counter = 0;
  }
  </code></pre>
  
  <p>Copy Constructor, which generates the error (I know this is iterator based)</p>
  
  <p>Graph.h:149:22: error: ‘std::vector::Edge*, std::allocator::Edge*> >::iterator’ has no member named ‘start’
      find(it_edge.start),find(it_edge.end),(*(it_edge))->weight));
                        ^</p>
  
  <p>Graph.h:149:40: error: ‘std::vector::Edge*, std::allocator::Edge*> >::iterator’ has no member named ‘end’
      find(it_edge.start),find(it_edge.end),(*(it_edge))->weight));
                                          ^</p>
  
  <pre><code>template &lt;typename Object, typename Weight&gt;
  graph&lt;Object, Weight&gt;::graph(graph&lt;Object, Weight&gt;&amp; G) {//Copy Constructor
  
      typename std::vector&lt;graph&lt;Object, Weight&gt;::Vertex*&gt;::iterator it_vert;
  
      for(it_vert = vertex.begin(); it_vert != vertex.end(); ++it_vert){
        vertex.push_back(new Vertex((*(it_vert))-&gt;element));
      }
  
      typename std::vector&lt;graph&lt;Object, Weight&gt;::Edge*&gt;::iterator it_edge;
  
      for(it_edge = edge.begin(); it_edge != edge.end(); ++it_edge){
        edge.push_back(new Edge(
        find(it_edge.start),find(it_edge.end),(*(it_edge))-&gt;weight));
      }
  
  }
  </code></pre>