3
Shouts

C#/.NET Little Pitfalls: Implicit Zero To Enum Conversion

published 477 days, 6 hours, 3 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 479 days, 3 hours, 38 minutes ago
Saturday, January 28, 2012 11:04:38 PM GMT Friday, January 27, 2012 1:29:56 AM GMT

Many times, we create overloaded methods or constructors to allow them to accept different kinds of data. Further, there are times that we may accept object when any value will do. This works well (aside from boxing/unboxing concerns for value types), but if you have an overload that accepts object and one that takes an enum, and you pass a constant expression of 0, where does it go?

category: Web Dev | clicked: 21 | | source: www.blackrabbitcoder.net | show counter code
tags: enum, .NET, conversion, C#, Implicit, Little Pitfalls

1 comment posted.

To post your comment please login or signup