Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code with generic types
Message
 
 
À
09/11/2008 07:24:36
Information générale
Forum:
Level Extreme
Catégorie:
Autre
Divers
Thread ID:
01360734
Message ID:
01360740
Vues:
22
>Michel,
>
>Is there anything that can be done to allow LessThan + CharExpression + GreaterThan in code fragments
>
>This 'eats' part of the code in preview mode. Problem is you just don't know how it will look like
>
>
>class xxx<T> where T : IComparable<T>
>{
> 
>}
>public static partial class ExtensionMethods
>{
>        public static bool InList<T>(this T s, params T[] list) where T : IEquatable<T>
>		{
>			return list.Contains(s);
>		}
>}
>
>
>If I use « and » instead of LT and GT you see what I mean but I have to manually edit the code
>
>class xxx«T» where T : IComparable«T»
>{
> 
>}
>public static partial class ExtensionMethods
>{
>        public static bool InList«T»(this T s, params T[] list) where T : IEquatable«T»
>		{
>			return list.Contains(s);
>		}
>}
>
>
>thanks,

C# code is starting to make me hot ;-) Actually saying that semi-seriously. I am immersed in it up to my eyeballs and liking it. The strong type and parameter checking are among the reasons. The compiler error messages and warnings leave earlier compilers I have worked with in the dust.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform