比较swift中的元组数组

比较swift中的元组数组,swift,tuples,Swift,Tuples,我已经为我的tuple类型声明了以下内容: publicTypeAlias Http2HeaderTableEntry=(字段:字符串,值:字符串?) func==(lhs:[Http2HeaderTableEntry],rhs:[Http2HeaderTableEntry])->Bool{ guard lhs.count==rhs.count else{return false} 对于lhs.enumerated()中的(idx,element){ guard element.field==r

我已经为我的
tuple
类型声明了以下内容:

publicTypeAlias Http2HeaderTableEntry=(字段:字符串,值:字符串?)
func==(lhs:[Http2HeaderTableEntry],rhs:[Http2HeaderTableEntry])->Bool{
guard lhs.count==rhs.count else{return false}
对于lhs.enumerated()中的(idx,element){
guard element.field==rhs[idx]。field&&element.value==rhs[idx]。value-else{
返回错误
}
}
返回真值
}
但是现在当我尝试在断言中使用它时,比如
xctasertequal(var1,var2)
我得到了一个编译器错误:

无法使用类型为“([Http2HeaderTableEntry],[Http2HeaderTableEntry])的参数列表调用“XCTAssertEqual”


为了能够比较Swift 4中的两个元组数组,我需要做些什么?

因为元组还没有一致性,所以目前还没有一种通用的方法来实现这一点


传递给
xctasertequal
的值需要符合
equalable
的要求。可能重复