Re: Why can't switch be used for objects
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 24 Jun 2005 09:38:42 -0700
1. Because it would be grossly slow.
2. Because the semantics of comparison are unclear (do you use equality
by reference, or use the Equals method, or do you allow IComparers,
or... ?)
3. Because if you need this then there is probably some other (cleaner)
way to do what you want to do... which is why I'm wondering exactly
where you need this switch statement and for what, in order to propose
an alternate design. :-)
.
- Follow-Ups:
- Re: Why can't switch be used for objects
- From: Jon Skeet [C# MVP]
- Re: Why can't switch be used for objects
- References:
- Why can't switch be used for objects
- From: cody
- Re: Why can't switch be used for objects
- From: Bruce Wood
- Re: Why can't switch be used for objects
- From: cody
- Why can't switch be used for objects
- Prev by Date: Re: Inheritance question
- Next by Date: How to set dategrid auto row height?
- Previous by thread: Re: Why can't switch be used for objects
- Next by thread: Re: Why can't switch be used for objects
- Index(es):
Relevant Pages
|