Re: generics - constraint
- From: Michael Moreno <abc@xxxxxxx>
- Date: Sun, 14 Jan 2007 06:52:18 GMT
No, I think the best you can do is write a static constructor that
checks typeof(T) and throws an exception if it isn't int, float, or
double.
Thanks. Generics are very limited then because you cannot perform any operator >, <, +, -, *, / in the code.
I hope they will fix that!
--
----------------------------------------------
http://michael.moreno.free.fr/
.
- Follow-Ups:
- Re: generics - constraint
- From: Jon Skeet [C# MVP]
- Re: generics - constraint
- References:
- generics - constraint
- From: Michael Moreno
- Re: generics - constraint
- From: Jesse McGrew
- generics - constraint
- Prev by Date: Re: generics - constraint
- Next by Date: Re: Boxing and Unboxing ??
- Previous by thread: Re: generics - constraint
- Next by thread: Re: generics - constraint
- Index(es):
Relevant Pages
|