title: 'std::vector<double>::iterator' has no member named 'begin'
body: <p>So I am trying to perform recursion ( A very simple code for split radix recursive butterflies)  on a large C++ STL vector and I am using iterators to call the recursion but it isn't working as I keep getting errors.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
  template &lt;typename T&gt;
  class fft_data{
  public: 
  vector&lt;T&gt; re;
  vector&lt;T&gt; im;
  
  };
  
  void inline split_radix_rec(vector&lt;double&gt;::iterator r,vector&lt;double&gt;::iterator i, int sgn,int N) {
  if (N == 1) {
      return;
  } else if (N == 2) {
      for (int k = 0; k &lt; N/2; k++) {
          int index = 2*k;
          int index1 = index+1;
          double taur =  *(r+index1);
          double taui =  *(i+index1);
  
          *(r+index1) = *(r+index) - taur; 
          *(i+index1) = *(i+index) - taui; 
  
          *(r+index) = *(r+index) + taur; 
          *(i+index) = *(i+index) + taui; 
      }
      N=N/2;
  } else {
      int m = N/2;
      int p = N/4;
  
      double PI2 = 6.28318530717958647692528676655900577;
      double theta =  -1.0 * sgn * PI2/N;
  
      double S =  sin(theta);
      double C =  cos(theta);
  
      double PI6 =  3.0*6.28318530717958647692528676655900577;
      double theta3 =  -1.0 * sgn * PI6/N;
  
      double S3 =  sin(theta3);
      double C3 =  cos(theta3);
  
      double wlr =  1.0;
      double wli =  0.0;
  
      //T wl2r = (T) 1.0;
      //T wl2i = (T) 0.0;
  
      double wl3r =  1.0;
      double wl3i =  0.0;
  
      double tau1r,tau1i,tau2r,tau2i;
      double ur,ui,vr,vi;
  
      for (int j = 0; j &lt; p; j++) {
          int index1 = j+m;
          int index2 = index1+p;
          int index3 = j+p;
  
          tau1r = *(r+index1);
          tau1i = *(i+index1);
  
          tau2r = *(r+index2);
          tau2i = *(i+index2);
  
          ur = tau1r + tau2r;
          ui = tau1i + tau2i;
  
          vr = sgn* (tau2r - tau1r);
          vi = sgn* (tau2i - tau1i);
  
          *(r+index2) = *(r+index3) - vi;
          *(i+index2) = *(i+index3) + vr;
  
          *(r+index1) = *(r+j) - ur;
          *(i+index1) = *(i+j) - ui;
  
          *(r+index3) = *(r+index3) + vi;
          *(i+index3) = *(i+index3) - vr;
  
          *(r+j) = *(r+j) + ur;
          *(i+j) = *(i+j) + ui;
  
      }
  
      split_radix_rec(r.begin(),i.begin(),sgn,m);
      split_radix_rec(r.begin()+m,i.begin()+m,sgn,p);
      split_radix_rec(r.begin()+m+p,i.begin()+m+p,sgn,p);
  }
  
  
  }
  
  
  int main() {
  vector&lt;double&gt; u,v;
  for (int i = 0; i &lt; 256; i++) {
      u.push_back(i);
      v.push_back(i);
  }
  
  int sgn = 1;
  int N = 256;
  split_radix_rec(u.begin(),v.begin(),sgn,N);
  return 0;
  }
  </code></pre>
  
  <p>Here are the errors I am getting</p>
  
  <pre><code>main.cpp:93:21: error: 'std::vector&lt;double&gt;::iterator' has no member named 'begin'
  </code></pre>
  
  <p>6 Identical errors on lines 93,94,95 (the three split_radix_rec() functions called from within the split_radix_rec function). This is part of a much larger code so I want it to work for STL vectors. What am I doing wrong?</p>