gpt4 book ai didi

rust - 是问号运算符?相当于试试!宏观?

转载 作者:行者123 更新时间:2023-11-29 07:40:47 53 4
gpt4 key购买 nike

我正在寻找一种方法来链接 Rust 中 try! 宏的使用,并找到了 this pull request that implements the ? operator .

它好像已经被合并了,但我似乎还找不到任何关于它的文档。它等同于 try! 宏还是有重要区别?

最佳答案

是的,? 运算符等同于 try!()? 现在在稳定的 Rust 1.13 中,released on November 10, 2016 .

目前最好的文档来源似乎是 RFC 0243 .请注意,RFC 中描述的 catch 在撰写本文时尚未实现 (issue)。

关于rust - 是问号运算符?相当于试试!宏观?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40545332/

53 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com