Added ability for custom_function to use something besides std::function