mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-30 23:47:58 +00:00
12 lines
360 B
C++
12 lines
360 B
C++
struct Leaf { int amount; };
|
|
struct Branch { Leaf* leaf; };
|
|
struct Root { Branch* branch; };
|
|
struct Other { int value; };
|
|
int read(Root& root, Other& other) {
|
|
return root.branch->leaf->amount + other.value;
|
|
}
|
|
void write(Root& root, int value) {
|
|
root.branch->leaf->amount = value;
|
|
}
|
|
const char *label = "value";
|
|
// value on Other must remain unchanged.
|