Void returns are permitted by the C++ standard, as in this code snippet:
void f();
void g() { return f(); }
This is a valid usage of boost::function because void returns are not used. With void returns, we would attempting to compile ill-formed code similar to:
int f();
void g() { return f(); }
In essence, not using void returns allows
boost::function to swallow a return value. This is
consistent with allowing the user to assign and invoke functions and
function objects with parameters that don't exactly match. |