Replies: 4 comments
-
编译器挂了,你得到 gcc 那边去反馈,不是这里 |
Beta Was this translation helpful? Give feedback.
0 replies
-
我发现gcc13版本依然有相同的bug
module;
#include <queue>
#include <string>
export module leetcode_treenode_cpp.bfsTravelsal;
import leetcode_treenode_cpp.TreeNode;
namespace leetcode_treenode_cpp {
export
std::string
bfsTravelsal(TreeNode* root)
{
std::string result = "[";
std::queue<TreeNode*> nodeQueue;
nodeQueue.push(root);
while (!nodeQueue.empty()) {
TreeNode* node = nodeQueue.front();
nodeQueue.pop();
if (node == nullptr) {
result += "null,";
} else {
result += std::to_string(node->val) + ",";
nodeQueue.push(node->left);
nodeQueue.push(node->right);
}
}
if (result == std::string("[null,")) {
return "[]";
}
result[result.size() - 1] = ']';
return result;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
编译器内部问题,你要到 gcc 那边反馈。。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
这个代码可以在msvc上编译成功,但是在gcc上编译失败,求助??
https://github.com/masx200/leetcode-treenode-cpp/blob/d1e0a51f91c96110da15fa74e6d9769b838ea92f/.github/workflows/c-cpp.yml
https://github.com/masx200/leetcode-treenode-cpp/blob/d1e0a51f91c96110da15fa74e6d9769b838ea92f/LeetCodeTreeNodeToString.ixx
https://github.com/masx200/leetcode-treenode-cpp/blob/d1e0a51f91c96110da15fa74e6d9769b838ea92f/xmake.lua
Beta Was this translation helpful? Give feedback.
All reactions