Skip to content

Instantly share code, notes, and snippets.

@Glamhoth
Created April 30, 2019 09:59
Show Gist options
  • Save Glamhoth/105fed63aa978c601f456377e21deb50 to your computer and use it in GitHub Desktop.
Save Glamhoth/105fed63aa978c601f456377e21deb50 to your computer and use it in GitHub Desktop.
let mut cpu = CPU::new(|addr: usize| memory.read_value(addr) );
=============
impl<'a> CPU<'a>
{
pub fn new<F>(read_memory: F) -> Self
where F: Fn<(usize), Output=u8> + 'a,
{
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment