Код: Выделить всё
virtual std::any visitChildren(ParseTree *node) override {
std::any result = defaultResult();
size_t n = node->children.size();
for (size_t i = 0; i < n; i++) {
if (!shouldVisitNextChild(node, result)) {
break;
}
std::any childResult = node->children[i]->accept(this);
result = aggregateResult(std::move(result), std::move(childResult));
}
return result;
}
Я ожидал
Код: Выделить всё
if (!shouldVisitNextChild(node->children[i], result)) {
break;
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... -parent-in
Мобильная версия