unlink the links

This commit is contained in:
Сергей Маринкевич
2025-07-23 17:44:25 +07:00
parent d17c80a195
commit 55ef99c848
10 changed files with 58 additions and 44 deletions
+4 -1
View File
@@ -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";