unlink the links
This commit is contained in:
+4
-1
@@ -1,7 +1,9 @@
|
||||
#include "nodes/SimpleNode.h"
|
||||
#include <iostream>
|
||||
|
||||
void printTree(const NodePtr& startNode, int indent = 0) {
|
||||
void printTree(const MixinPtr& start, int indent = 0) {
|
||||
if (!start) return;
|
||||
auto startNode = std::dynamic_pointer_cast<INode>(start);
|
||||
if (!startNode) return;
|
||||
for (int i = 0; i < indent; ++i) std::cout << " ";
|
||||
std::cout << startNode->name() << "\n";
|
||||
@@ -47,6 +49,7 @@ int main() {
|
||||
child1->unlinkParent();
|
||||
std::cout << "\nTree after unlink:\n\n\n";
|
||||
printTree(root);
|
||||
std::cout << "\n\n";
|
||||
}
|
||||
|
||||
std::cout << "\nTree after scope out:\n\n\n";
|
||||
|
||||
Reference in New Issue
Block a user