Partydonk / partydonk

MIT License
33 stars 1 forks source link

Implement a default equality/subtraction operators #7

Open benaadams opened 4 years ago

benaadams commented 4 years ago

Implement a default subtraction operator using negation operator and addition

Use it to produce an enumerable of differences in the sequence.

benaadams commented 4 years ago

To demonstrate virtual also? (so if an operator can be defined in terms of another; it can be by default to reduce ceremony)

Might not be the actual INumeric approach due to unsigned types; but helps with communicating the possibilities?

benaadams commented 4 years ago

Also add default == and != to demonstrate the reduction in ceremony.

e.g. implement IEquatable<T>.Equals and get == and != for free.