Skip to content

Instantly share code, notes, and snippets.

@sinfu
Created October 25, 2010 08:06
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 sinfu/644579 to your computer and use it in GitHub Desktop.
Save sinfu/644579 to your computer and use it in GitHub Desktop.
struct S
{
int value = 9999;
void change()
{
value = 1;
}
}
struct R
{
S s;
}
int test()
{
S s;
s.change();
assert(s.value == 1); // succeeds
R r;
r.s.change();
assert(r.s.value == 1); // fails, value == 9999
return 0;
}
enum _ = test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment