class HelloWorldNode {
public:
  HelloWorldNode(HelloWorldNode * parent, string data)
  : parent(parent),
    data(data)
  {
    if (parent)
      parent.children.add(this);
  }
  ~HelloWorldNode()
  {
    if (parent)
      parent.children.erase(this);
  }
  void print() {
    cout << data;
    for (auto child : children)
      child.print();
  }
private:
  HelloWorldNode * parent;
  string data;
  set<HelloWorldNode*> children;
};

using HWN = HelloWorldNode;

int main() {
  HWN hello(0, “hello”);
  HWN space(&hello, “ “);
  HWN world(&space, “world”);
  HWN bang(&world, “!”);
  HWN decorations[] = {
    HWN(&hello, “\t”),
    HWN(&world, “~~”),
    HWN(&bang, “#”)
  };
  hello.print();
}
  • [spam][crazy... Undescribed Horrific Abuse, One Victim & Survivor of Many
    • Re: [sp... Undescribed Horrific Abuse, One Victim & Survivor of Many
      • Re:... Undescribed Horrific Abuse, One Victim & Survivor of Many
        • ... Undescribed Horrific Abuse, One Victim & Survivor of Many
          • ... Undescribed Horrific Abuse, One Victim & Survivor of Many
            • ... Undescribed Horrific Abuse, One Victim & Survivor of Many
              • ... Undescribed Horrific Abuse, One Victim & Survivor of Many
                • ... Undescribed Horrific Abuse, One Victim & Survivor of Many

Reply via email to