title: Removing elements of 2D vector
body: <p>I have a 2D vector and I need to remove blocks that do not contain sufficient values:</p>
  
  <pre><code>typedef vector&lt;double&gt; iniMatrix;
  
  
  bool hasInsufficientEnergy() {
  return true;
  }
  vector&lt;double&gt; Audio::filter(vector&lt;iniMatrix&gt;&amp;blocks, double sumThres, double ZeroThres)
  {
    vector&lt;double&gt; totalEnergy;
    vector&lt;double&gt; totalZeroCross;
    double totalSum = sumThres * blocks.size();
    double totalZero = ZeroThres * blocks.size();
  
    vector&lt;iniMatrix&gt; blockked;
  
    for(unsigned i=0; (i &lt; blocks.size()); i++)
    {
      totalEnergy.push_back(abs(this-&gt;energy(blocks[i])));
      totalZeroCross.push_back(zerocross(blocks[i]));
  
      if(!totalEnergy[i] &gt; totalSum || totalZeroCross[i] &lt; ZeroThres)
      {
          hasInsufficientEnergy();
      }else{
          //hasInsufficientEnergy();
      }
      iniMatrix::iterator erase_after = remove_if(blocks[i].begin(), blocks[i].end(),
                                                  &amp;hasInsufficientEnergy);
   }
   }
  </code></pre>
  
  <p>The problem is erase_after and comes up with an error message:</p>
  
  <pre><code>In function ‘_OutputIterator std::remove_copy_if(_InputIterator, _InputIterator, 
   _OutputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator&lt;double*, 
  std::vector&lt;double, std::allocator&lt;double&gt; &gt; &gt;, _OutputIterator = 
  __gnu_cxx::__normal_iterator&lt;double*, std::vector&lt;double, std::allocator&lt;double&gt; &gt; &gt;, 
  _Predicate = bool]’:
  /usr/include/c++/4.2.1/bits/stl_algo.h:1302:   instantiated from ‘_ForwardIterator 
  std::remove_if(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = 
  __gnu_cxx::__normal_iterator&lt;double*, std::vector&lt;double, std::allocator&lt;double&gt; &gt; &gt;, 
  _Predicate = bool]’
  Audio.cpp:105:   instantiated from here
  /usr/include/c++/4.2.1/bits/stl_algo.h:1227: error: ‘__pred’ cannot be used as a function
  </code></pre>
  
  <p>Anyone have any ideas to where I am going wrong?</p>