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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World