Consider following comparison function:
bool compare(std::shared_ptr &lhs, std::shared_ptr &rhs){ return lhs->val
decltype(compare)* in the template parameter specifies the type of the comparator. It doesn't tell which function is to be used - whether is it compare, foo, bar or something else. Hence the constructor parameter.
decltype(compare)*
compare
foo
bar