title: Clearing a Vector space
body: <p>Hi people a quick question:</p>
  
  <p>I have set a vector to a certain size, What i want to do is to empty that vector once it Hits the maximum space.</p>
  
  <p>I have this Code for this: </p>
  
  <pre><code>vector&lt;Point&gt; Rightarm(20); 
      vector&lt;Point&gt; Leftarm(20);
  
      vector&lt;Point&gt;::const_iterator RightIter;
      vector&lt;Point&gt;::const_iterator LeftIter;
  
  Rightarm.push_back(center);
      Leftarm.push_back(center1); 
  
      for(RightIter = Rightarm.begin(); RightIter != Rightarm.end(); ++RightIter)
      {
          circle(drawing, *RightIter, 3, Scalar(0,255,0), CV_FILLED); 
      }
  
      if(RightIter == Rightarm.end())
          {
              Rightarm.clear();
          }
  
      for(LeftIter = Leftarm.begin(); LeftIter != Leftarm.end(); ++LeftIter)
      {
          circle(drawing, *LeftIter, 3, Scalar(0,255,0), CV_FILLED);
  
      }
  
          if(LeftIter == Leftarm.end())
          {
              Leftarm.clear();
          }
  </code></pre>
  
  <p>The issue I have with this code is that the vector gets cleared every time...Where I want it to be emptied only after it hits the size limit of 20....</p>
  
  <p>Can anyone spot where am going wrong with this...?</p>