Skip to content

Instantly share code, notes, and snippets.

/ptr_to.zig Secret

Created February 23, 2018 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/44e529357cfe608096aa5005a8f02416 to your computer and use it in GitHub Desktop.
Save anonymous/44e529357cfe608096aa5005a8f02416 to your computer and use it in GitHub Desktop.
const Test = struct
{
element_type: type,
pub fn get(comptime self: &const Test, instance: ptr_to(self.element_type)) void {}
};
fn ptr_to(comptime element_type: type) type { return &element_type; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment