Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Forward declare the inner class
- class inner;
- // The actual outer class.
- class outer {
- public:
- // This is the function you would like to call.
- int get_data();
- private:
- inner _inner;
- }
- // The actual definition of the inner class.
- class inner {
- public:
- inner(outer& o) : _outer(o) // Set the reference.
- {
- }
- // The function using the data in outer.
- void do_stuff()
- {
- int x = _outer.get_data() + 5;
- }
- private:
- // A reference to the outer class.
- outer& _outer;
- }
- __this = (outer*)((unsigned long long)this - (unsigned long long)(&((outer*)0)->inner_instance));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement