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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -