diff --git a/dispatchkit/dispatchkit.hpp b/dispatchkit/dispatchkit.hpp index bc3d0a1a..2466f03b 100644 --- a/dispatchkit/dispatchkit.hpp +++ b/dispatchkit/dispatchkit.hpp @@ -31,24 +31,15 @@ namespace dispatchkit m_scopes.push_back(Scope()); } - void register_function(const boost::shared_ptr &f, const std::string &name) + bool register_function(const boost::shared_ptr &f, const std::string &name) { - if (!add_function(f, name)) - { - std::cout << "Unable to add function: " << name - << " another function with the exact signature exists." << std::endl; - } - } - + return add_function(f, name); + } template - void register_function(const Function &func, const std::string &name) + bool register_function(const Function &func, const std::string &name) { - if (!add_function(boost::shared_ptr(new Proxy_Function_Impl(func)), name)) - { - std::cout << "Unable to add function: " << name - << " another function with the exact signature exists." << std::endl; - } + return add_function(boost::shared_ptr(new Proxy_Function_Impl(func)), name); }