我知道在f#中,我可以將out
參數作爲結果元組的成員,當我使用它們從F#開始時,例如,如何創建一個在F#中具有輸出參數的成員
(success, i) = System.Int32.TryParse(myStr)
我想知道我是怎麼定義的成員有,似乎C#作爲具有out
參數簽名。
可以做到這一點嗎?我可以返回一個元組,並在我從C#調用方法時發生相反的過程,例如
type Example() =
member x.TryParse(s: string, success: bool byref)
= (false, Unchecked.defaultof<Example>)