0
在C++中,我可以像這樣實現它。類在Swift中繼承它的泛型
template<typename MyType>
class MyClass : public MyType
{
};
在Swift中可以這麼做嗎?
///Compiler error: Inheritance from non-procotol, non-class type 'T'
class MyClass<MyGeneric> : MyGeneric
{
}
不,這是不可能的。你爲什麼想要這個? – Hamish
你不是指'class MyClass:MyGeneric {}'...?因爲你的語法根本沒有意義。 –
holex