I must find out if T
value equals default(T)
value.
Is there any simple to do that ?
Asked
Active
Viewed 77 times
0

Dmitry Bychenko
- 180,369
- 20
- 160
- 215

Imugi
- 161
- 1
- 3
- 13
-
2`instance == default(T)` or `instance.Equals(default(T))`. The assumption is you override Equals or the equality operator. – Igor Mar 14 '16 at 12:56
-
http://stackoverflow.com/questions/4832192/cant-compare-t-value1-with-t-value2-defaultt-why-and-how-to-do-that-on-c – monstertjie_za Mar 14 '16 at 12:57
-
nope, operator ==, cannot be applied to operands of 'T' and 'T' – Imugi Mar 14 '16 at 12:59
-
thanks everyone, it's a dub indeed – Imugi Mar 14 '16 at 13:01