#include "tree.hpp" #include void test_tree() { Tree tree; auto* virus = tree.create_leaf("Virus"); auto* worm = tree.create_leaf("Worm"); auto* test = virus->create_leaf("test"); test->create_leaf("a"); test->create_leaf("b"); test->create_leaf("c"); test->create_leaf("884"); tree.walk([](auto* node) { auto tab_count = node->parent_count(); auto& data = node->data(); for(auto i = 0; i < tab_count; ++i) std::printf("\t"); if(data.empty()) { std::printf("(root)\n"); } else { std::printf("%s\n", data.c_str()); } }); } int main() { test_tree(); return 0; }