I was learning some basic cpp and I found out that we can pass lambda functions to a function accepting a std::function like below:
int someFunction(std::function<int(int, int)> sum) {
return sum(1,3);
}
I was confused as to how the std::function is taking template types as "int(int, int)" generally I have only see classes taking types like someClass<int, int>.
How do we define classes that take the template types like "int(int, int)"?
I tried declaring classes like
template<typename A(typename B)> // --> this just gives an syntax error.
class SomeClass {};