Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code with generic types
Message
 
 
To
09/11/2008 07:24:36
General information
Forum:
Level Extreme
Category:
Other
Miscellaneous
Thread ID:
01360734
Message ID:
01360740
Views:
23
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform