Replies: 2 comments
-
@steveharter is this possible.. |
Beta Was this translation helpful? Give feedback.
0 replies
-
MethodInfo mi = ...
var ptr = mi.MethodHandle.GetFunctionPointer();
// now call a delegate .ctor using that ptr https://stackoverflow.com/questions/3915827/get-ldftn-function-pointer-in-c-sharp |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write some code that wants to do some different handling depending on the T. Normally, I'd have used a delegate, but I was hoping to use func pointers for this indirection could not figure out if there was a way to do this.
Now I can write this but it's completely horrible
As this requires me to create a delegate and then use reflection on delegate to get the private field
_methodPtrAux
Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions