CSharp?
ジェネリッククラスの定義
class MyGenericClass1<T> where T : struct {
// 制約:Tは構造体
}
class MyGenericClass2<T> where T : class {
// 制約:Tはクラス
}
class MyGenericClass3<T> where T : new() {
// 制約:Tはインスタンス化可能
}
class MyGenericClass4<T> where T : MyOtherClass {
// 制約:TはMyOtherClassクラスを継承
}
class MyGenericClass5<T> where T : IMyInterface {
// 制約:TはIMyInterfaceインターフェイスを実装
}
class MyGenericClass6<T, U> where T : U {
// 制約:Tは別の型パラメータUを継承
}
//////////////////////////////////////////////////
class MyOtherClass {
// あるクラス
}
interface IMyInterface {
// あるインターフェイス
}
コメント:
Šy“Vƒ‚ƒoƒCƒ‹[UNLIMIT‚ª�¡‚Ȃç1‰~]
ECƒiƒr‚Ń|ƒCƒ“‚Æ Yahoo Šy“V LINE‚ªƒf�[ƒ^�Á”ïƒ[ƒ�‚ŌŽŠz500‰~�`�I
–³—¿ƒz�[ƒ€ƒy�[ƒW –³—¿‚̃NƒŒƒWƒbƒgƒJ�[ƒh ŠCŠOŠiˆÀ�q‹óŒ” ‰ð–ñŽ萔—¿‚O‰~�y‚ ‚µ‚½‚łz
ŠCŠO—·�s•ی¯‚ª–³—¿�I ŠCŠOƒzƒeƒ‹