Ranged integers in .NET (or C#)

Posted by Mal Ross on Stack Overflow See other posts from Stack Overflow or by Mal Ross
Published on 2010-03-08T17:01:09Z Indexed on 2010/03/08 17:06 UTC
Read the original article Hit count: 182

Filed under:
|
|

Am I being blind, or does the .NET framework not provide any kind of ranged integer class? That is, a type that would prevent you setting a value outside some given bounds that are not the full range of the basic data type. For example, an integer type that would restrict its values to between 1 and 100. Showing my age here, but back in '93, I remember using that sort of thing in Modula-2 (eeek!), but I've not seen explicit framework / language support for it since.

Am I just missing something, or is it a case of "it's so simple to make your own that the framework doesn't bother"?

Cheers.

© Stack Overflow or respective owner

Related posts about ranges

Related posts about .NET