use std::logical_and to combine two conditions
<pre><code>    int nums[] = {7, 6, 12, 9, 29, 1, 67, 3, 3, 8, 9, 77};
    std::vector&lt;int&gt; vecInts(&amp;nums[0], &amp;nums[0] + sizeof(nums)/sizeof(nums[0]));

    int countBoost = 0;

    // (i &gt; 5 &amp;&amp; i &lt;=10)
    countBoost = std::count_if(vecInts.begin(), vecInts.end(),
                      boost::bind(std::logical_and&lt;bool&gt;(), 
                                  boost::bind(std::greater&lt;int&gt;(),    _1, 5),
                                         boost::bind(std::less_equal&lt;int&gt;(), _1, 10))
                          );
</code></pre>

<p>Now, I need to implement the same logical with pure STL. How can I do that?</p>

<p>I have tried the following code and it doesn't work:</p>

<pre><code>int countSTL   = std::count_if(vecInts.begin(), vecInts.end(),
                           std::logical_and&lt;bool&gt;(std::bind2nd(std::greater&lt;int&gt;(), 5), std::bind2nd(std::less_equal&lt;int&gt;(), 10))                               
                          );
</code></pre>

<p>Thank you</p>

<p>// Updated //</p>

<pre><code>In Effective STL Item 43, Meyers indicates as follows:

vector&lt;int&gt;::iterator i = find_if(v.begin(), v.end(),
           compose2(logical_and&lt;bool&gt;(), bind2nd(greater&lt;int&gt;(), x),
                                         bind2nd(less&lt;int&gt;(), y)));
</code></pre>

<blockquote>
  <p>But compose2 is NOT a standard function object adapter.</p>
</blockquote>
