Following on @Xeo's excellent code:
I'm wondering how to template the function's return type, so that instead of interpreting the return through:
std::string* out_opt
it could instead return the appropriate type for a given function.
Also, following on @Xeo's example code, I wondering what the best way to bind member functions that have multiple arguments would be...
func_dict["someFunc"] = stream_function<int(int,int)>( std::bind( &MyClass::functionName, instanceOfMyClass, std::_1, std::_2 ) );
Is this a good approach? Is there any way to do away with needing to explicitly state _1, _2, etc.?