I got a (simplified) function Foo
template<typename It, typename T>
void Foo(It begin, It end, T&& CallBar)
{
CallBar(begin, end);
}
And another simplified function Bar
template<typename It>
It Bar(It begin, It end)
{
return begin;
}
When I call both functions in the following way
std::vector<int> v{ 3, 8, 2, 5, 1, 4, 7, 6 };
Foo(v.begin(), v.end(), Bar);
I get the error
'declaration' : could not deduce template argument for 'identifier'
What else do I have to specify to make it compile?
Bar:Foo(v.begin(), v.end(), [](auto begin, auto end) {return begin;});- maxbc