July 2004 - Posts

Are Generics in .NET like Templates in C++?
28 July 04 10:42 AM
No. While Generic types do have a similar syntax to C++ templates, they are instantiated at runtime as opposed to compile time, and they can be reflected on via meta-data. Also, in Generics, member access on the type paramater is verified based on the Read More...
Postedby CSharpFAQ | 9 Comments    
Why does my switch statement works differently?
22 July 04 05:50 PM
C# does not support an explicit fall through for case blocks (unless the block is empty) For an explanation of why, see Why is the C# switch statement designed to not allow fall through, but still require a break? on MSDN The following code is not legal Read More...
Postedby CSharpFAQ | 5 Comments    
Why does C#'s iterators feature spit out a class definition instead of a struct definition?
20 July 04 10:30 AM
Q: Why does C#'s iterators feature spit out a class definition instead of a struct definition? The iterators feature in C# generates classes that implement the enumerators required. This is detailed in the C# Specification . Why doesn't it use structs, Read More...

This Blog

Syndication

Page view tracker