Created
May 14, 2018 11:43
-
-
Save wardenlym/6a254de10882fe09da290025ccca6c6f to your computer and use it in GitHub Desktop.
如果去掉msg code 的风格
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Demo | |
{ | |
class Ret<R> | |
{ | |
int error = -1; | |
R res; | |
} | |
interface request { } | |
interface response_of<T> { } | |
class a_req : request | |
{ | |
} | |
class a_res : response_of<a_req> | |
{ | |
} | |
delegate void rpc_callback<R>(R r); | |
delegate void rpc_call<T, R>(T t, rpc_callback<Ret<R>> f) where T : request where R : response_of<T>; | |
void rpc_invoke<T,R>(T a, rpc_callback<Ret<R>> f) where T: request where R: response_of<T> | |
{ | |
} | |
public void test3() | |
{ | |
rpc_invoke(new a_req(), (Ret<a_res> res) => | |
{ | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment