Re: Boxing and Unboxing ??
- From: "Ignacio Machin \( .NET/ C# MVP \)" <machin TA laceupsolutions.com>
- Date: Wed, 17 Jan 2007 10:27:22 -0500
| >
| Ah so the boxing and unboxing overhead that does not cost very much
It can cost a lot, if you use it in a loop it can count for a big chunk of
the process.
| adds a lot of versatility to the underlying functionality while
maintaining type safety.
Maintaining type safety how?
In reality you lose the type safety, when you box an int for example you
will get an object reference, you could try to cast it to any other type and
get an error, unfortunately this error will be detected at runtime and not
at compile time. so it does not help but quite the opposite.
|It
| is comparable to the slight extra overhead that polymorphism requires yet
| providing much more versatile code.
Not at all, they are two very different things.
--
Ignacio Machin
machin AT laceupsolutions com
.
- Follow-Ups:
- Re: Boxing and Unboxing ??
- From: Barry Kelly
- Re: Boxing and Unboxing ??
- References:
- Boxing and Unboxing ??
- From: Peter Olcott
- Re: Boxing and Unboxing ??
- From: Bob Graham
- Re: Boxing and Unboxing ??
- From: Peter Olcott
- Re: Boxing and Unboxing ??
- From: Bob Graham
- Re: Boxing and Unboxing ??
- From: Peter Olcott
- Re: Boxing and Unboxing ??
- From: Ignacio Machin \( .NET/ C# MVP \)
- Re: Boxing and Unboxing ??
- From: Peter Olcott
- Re: Boxing and Unboxing ??
- From: Jesse McGrew
- Re: Boxing and Unboxing ??
- From: Peter Olcott
- Boxing and Unboxing ??
- Prev by Date: Re: Selecting which monitor a form is displayed on
- Next by Date: Re: Boxing and Unboxing ??
- Previous by thread: Re: Boxing and Unboxing ??
- Next by thread: Re: Boxing and Unboxing ??
- Index(es):