So in it's most distilled form I have something like this going on,
template <class T>
bool f(const T &a, const T &b, std::function<bool(const T&, const T&)> func)
{
return func(a,b);
}
template <class T>
bool g(const T &a, const T &b)
{
return true;
}
But any attempt to call f()
, with anything, f('a', 'b', g)
, f(1, 2, g)
, always results in "no matching function for call to 'f'", regardless of whether I pass the variables as const references or just plain values or whatever. I'm assuming it's failing to deduce some template, but I have no idea where or why.
I will admit, I have a very tenuous grasp on how to use function objects in general, is doing something like this even possible?