You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TEST(test_expression, expression1) {
using namespace kuiper_infer;
const std::string &statement = "add(@1,@2)";
ExpressionParser parser(statement);
const auto &node_tokens = parser.Generate();
ShowNodes(node_tokens);
}
}
这里node_tokens的类型std::vector<std::shared_ptr>
而ShowNodes()接收的参数类型是std::shared_ptr<kuiper_infer::TokenNode>
所以会报错:No matching function for call to 'ShowNodes'
但是为啥up在b站视频里是对的呀,求教求教,感谢感谢
The text was updated successfully, but these errors were encountered:
up大佬你好,在8.1节课的代码中:
static void ShowNodes(const std::shared_ptr<kuiper_infer::TokenNode> &node) {
if (!node) {
return;
}
// 中序遍历的顺序
ShowNodes(node->left);
if (node->num_index < 0) {
if (node->num_index == -int(kuiper_infer::TokenType::TokenAdd)) {
LOG(INFO) << "ADD";
} else if (node->num_index == -int(kuiper_infer::TokenType::TokenMul)) {
LOG(INFO) << "MUL";
}
} else {
LOG(INFO) << "NUM: " << node->num_index;
}
ShowNodes(node->right);
}
TEST(test_expression, expression1) {
using namespace kuiper_infer;
const std::string &statement = "add(@1,@2)";
ExpressionParser parser(statement);
const auto &node_tokens = parser.Generate();
ShowNodes(node_tokens);
}
}
这里node_tokens的类型std::vector<std::shared_ptr>
而ShowNodes()接收的参数类型是std::shared_ptr<kuiper_infer::TokenNode>
所以会报错:No matching function for call to 'ShowNodes'
但是为啥up在b站视频里是对的呀,求教求教,感谢感谢
The text was updated successfully, but these errors were encountered: