Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decrement operator
Message
From
03/09/2008 06:35:52
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344042
Message ID:
01344415
Views:
13
>works but requires odd syntax: int i = (NonZeroInstance++).I

Viv,

Come to think of it. Implementing a type with operators takes some work

To implement
- ToString()
- Equals()
- GetHashCode()
- the casts (also an operator)
  - implicit casts (where there is no loss of precision)
  - explicit casts  ( with possible loss of precision)

- Operators - comparaison
==
!=
<
<=
>
>=

- Operators - arithmetic
++
--
+
-
/
*
Back in May, I have - as an excercise - written a Fraction class (as a structure: Nominator, denominator) with constructors a la var xx = new Fraction("1/11")

It took a lot of time, but I have also learned a lot
Should you be interested - I'll be happy to mail it
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform