added support for std::functional