c++ - Automatically Pass Parent Pointer to its Variables? -


this functionality have, wondering if there way able pass parent pointer it's variables without having = this?

struct location;  struct parent {     std::vector<location*> locations; };  struct location {      location(parent* p)     {         p->locations.push_back(this);     }  };   struct specialparent : parent {      location = this;     location b = this;     location c = this;     location zabazoo = this;      // etc  }; 

the point of can still specialparent->zabazoo still batch process locations operations.

location = b = c = zabazoo = this; 

the quick brown fox jumps on lazy dog.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -