Skip to content

Instantly share code, notes, and snippets.

@ClarkeRemy
Created August 22, 2023 19:41
Show Gist options
  • Save ClarkeRemy/b845e12ca1e86bca26efcd7ee0a3aaa7 to your computer and use it in GitHub Desktop.
Save ClarkeRemy/b845e12ca1e86bca26efcd7ee0a3aaa7 to your computer and use it in GitHub Desktop.
Call Erased (cursed)
fn call_later<T:Fn(&G),G>(_ : &T) -> unsafe fn(*const(), *const())
{
|p : *const (), g : *const()|
{ unsafe { (&*(p as *const T))(&*(g as *const G)) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment