|
Exemple 13-5 extrait du chapitre
La généricité
Exemple 13-4< > Exemple 13-6
Cet exemple peut être compilé avec la ligne de commande: csc.exe /target:library Exemple_13_5.cs Erreurs: 1 Avertissements: 0 Remarque:
Exemple_13_5.cs
interface I<T> { void Fct(); }
// Erreur de compilation:
// 'C<U,V>' cannot implement both 'I<U>' and 'I<V>' because they
// may unify for some type parameter substitutions.
class C<U, V> : I<U>, I<V>{
void I<U>.Fct() { }
void I<V>.Fct() { }
}
Copyright Patrick Smacchia 2006 2007
|