Skip to content

Instantly share code, notes, and snippets.

@janwilmans
Created February 8, 2018 10:35
Show Gist options
  • Select an option

  • Save janwilmans/04cd05409cbd0c71dc605374f790cc0a to your computer and use it in GitHub Desktop.

Select an option

Save janwilmans/04cd05409cbd0c71dc605374f790cc0a to your computer and use it in GitHub Desktop.
```c++
struct Z80
{
volatile uint8_t& memory(const uint16_t address)
{
return *reinterpret_cast<uint8_t*>(address);
}
};
int main()
{
Z80 z80;
auto useFreeLambda = [&]() {
z80.memory(0xa000) = 0x10;
};
useFreeLambda();
return 0;
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment