Rust part11at TECH
Rust part11 - 暇つぶし2ch476:デフォルトの名無しさん
21/07/28 23:25:02.98 SAGnL8kO.net
The syntax for a block is {, then any inner attributes, then any number of statements, then an optional expression, called the final operand, and finally a }.
The type of a block is the type of the final operand, or () if the final operand is omitted.
URLリンク(doc.rust-lang.org)
let foo = { fn_call(); }; // final operandがないのでブロックの型は()
let bar = { fn_call() }; // final operandがあるのブロックの型はfn_call()の型
式文が()を返すわけじゃない


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch