I define a method like so:

template &lt;class ArgT&gt;
void foo(ArgT arg, ::boost::function&lt; void(ArgT) &gt; func)
{
    func(arg);
}


and use it like this --for instance--:

foo(2, [](int i) -&gt; void { cout &lt;&lt; i &lt;&lt; endl; });


Why can't the compiler deduce the type since it's definitely an int?

I get 'void foo(ArgT,boost::function&lt;void(ArgT)&gt;)' : could not deduce template argument for 'boost::function&lt;void(ArgT)&gt;' from 'anonymous-namespace'::&lt;lambda0&gt;'.


Question: json load more items
Answer: When you get new data then after setting data to adapter please call adapter.notifyDataSetChanged();
That will notify the list that the data in adapter is changed

hope this will help