我已經用swift編寫了一個簡單的隊列類。它由一個Array實現。 現在我希望這更像內置數組。因此我需要實現[]運算符,但失敗。有人幫忙? public class SimpleQueue<T : Any>
{
private var frontCur = 0
private var reuseCur = -1
private var capacity = 0
我想確定我的計算表達一些運營商定製定義自定義操作,但不能使它工作 type ZipSeq() =
[<CustomOperation("<*>")>]
member this.Apply f s =
f |> Seq.zip s |> Seq.map (fun (y, x) -> x(y))
member this.Return x =
S