error: '__pred' cannot be used as a function
<p>I can't find what I'm doing wrong here. The function <code>eta</code> does what I ask but when I use it in the loop I get the attached error.</p>

<pre><code>bool eta(map&lt;string, TLorentzVector&gt; map_jets, string jet){
    return(  fabs(map_jets[jet].PseudoRapidity()) &gt; 2.5 );
}
</code></pre>

<p>and then</p>

<pre><code>vector&lt;pair&lt;string,double&gt; &gt; jets_pt( vec_jets.size() );

    for( vector&lt;pair&lt;string,double&gt; &gt;::iterator it = jets_pt.begin(); it != jets_pt.end(); ++it)
jets_pt.erase(remove_if(jets_pt.begin(),jets_pt.end(),eta(map_jets,it1-&gt;first)),jets_pt.end);
</code></pre>

<p>I get the error</p>

<pre><code>/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h: In function '_OutputIterator std::remove_copy_if(_InputIterator, _InputIterator, _OutputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _OutputIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _Predicate = bool]':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:1291:   instantiated from '_ForwardIterator std::remove_if(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _Predicate = bool]'
/misc/cdf/gbertoli/hww/Diboson_v20_taus/Ana/src/Functions.cc:25:   instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:1216: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h: In function '_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _Predicate = bool]':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:338:   instantiated from '_InputIterator std::find_if(_InputIterator, _InputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _Predicate = bool]'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:1287:   instantiated from '_ForwardIterator std::remove_if(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;*, std::vector&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt;, std::allocator&lt;std::pair&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, double&gt; &gt; &gt; &gt;, _Predicate = bool]'
/misc/cdf/gbertoli/hww/Diboson_v20_taus/Ana/src/Functions.cc:25:   instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:260: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:264: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:268: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:272: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:280: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:284: error: '__pred' cannot be used as a function
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algo.h:288: error: '__pred' cannot be used as a function
mv: cannot stat `/misc/cdf/gbertoli/hww/Diboson_v20_taus/tmp/Linux2.6-GCC_4_1/Ana/srt_dep_tmp.27294': No such file or directory
gmake[2]: *** [/misc/cdf/gbertoli/hww/Diboson_v20_taus/tmp/Linux2.6-GCC_4_1/Ana/libAna-shared/Functions.o] Error 1
gmake[1]: *** [src.lib] Error 2
gmake: *** [Ana.all] Error 2
</code></pre>
