Tricky RPC code using bind()

All,
I've written what I thought was a pretty clever RPC server using bind
and templated functions to make server callbacks typesafe. It all
resolves around this one function:
class rpc_server {
...
template

Sean Rhea wrote:
Currently, however, I can't get it to compile. The error from gcc 4.0.1 on OS X Tiger is:
g++ -c -g -I/usr/local/include/boost-1_33_1 -I.. rpc_server.cpp rpc_server.cpp: In member function 'void rpc_server::set_handler(int, int, int, int (*)(XDR*, A*), int (*)(XDR*, R*), boost::function
), std::allocator<void> >) [with A = example_args, R = example_res]': rpc_server.cpp:277: instantiated from here rpc_server.cpp:171: error: cannot resolve overloaded function 'call_req' based on conversion to type 'int' make: *** [rpc_server.o] Error 1 I've attached rpc_server.cpp.
Can anyone tell me why the compiler doesn't have the information it needs? It seems to have figured out what types A and R are. What else does it need to resolve call_req?
The A and R parameters of set_handler have been resolved, but the A and R parameters of call_req haven't. Try bind( &rpc_server::call_req, ... ), and similarly for the other binds.

On Feb 14, 2006, at 4:30 PM, Peter Dimov wrote:
The A and R parameters of set_handler have been resolved, but the A and R parameters of call_req haven't. Try bind( &rpc_server::call_req, ... ), and similarly for the other binds.
That did the trick. Thanks! Sean -- Everyone chooses his or her own instrument for rebellion. I don't know what my son's will be, but my only hope for him is this: That by sharing my passions with him, I have planted the seeds of defiance that will someday be turned against me. -- Soo Lee Young
participants (2)
-
Peter Dimov
-
Sean Rhea