[闲聊] Result<T, E>

楼主: yam276 ('_')   2025-10-03 15:11:19
我受不了傻逼C++ 没C++23就没好用的错误回传
只好让AI帮我写了一个模拟Result<T, E>
Result<int, Err> Read(std::string Input) { /*...*/ }
现在可以
obj.Read(input).match([](int t) {
// OK
},
[](Err e) {
// 错误处理
});
C++20根本是抄作业大师
作者: h0103661 (路人喵)   2025-10-03 15:14:00
throws C++
楼主: yam276 ('_')   2025-10-03 15:15:00
超恨

Links booklink

Contact Us: admin [ a t ] ucptt.com