Unable to compile a functor template
<p>I'm trying to define a function</p>

<pre><code>template&lt;typename Functor&gt; static void start(DataSize size, ThreadNum threadNum, Functor f)
{
    ....

    std::for_each&lt;int&gt;(allocated, size, f);

    ....
}
</code></pre>

<p>allocated and size are just int.</p>

<p>The caller calls the function</p>

<pre><code>start(image.width() * image.height(), _threads, RGBHistogramFun&lt;T&gt;(image, hist));
</code></pre>

<p>and </p>

<pre><code>template&lt;typename T&gt; class RGBHistogramFun
{
    ...

    void operator()(std::size_t i)
    {
        ....
    }
}
</code></pre>

<p>I set T to int for the template. I'm trying to define std::for_each so that it calls RGBHistogramFun::operator(std::size_t i) for each integer from allocated to size. The operator() will use the index to manipulate its internal array data.</p>

<p>However, I'm getting compiler error something about xutility.</p>
