如何创建一个泛型数组?例如:
struct Thing<Any> {
}
let intThing = Thing<Int>()
let stringThing = Thing<String>()
// This line doesn't compile
// Cannot convert value of type 'Thing<Int>' to expected type 'Thing'
let things: [Thing] = [intThing, stringThing]
我该如何声明一个任意类型的泛型(类似于
Thing<?>
或 Thing<Any>
)?