how are nullable types implemented under the hood in .net?

Posted by CrazyJugglerDrummer on Stack Overflow See other posts from Stack Overflow or by CrazyJugglerDrummer
Published on 2010-03-23T21:36:28Z Indexed on 2010/03/23 21:43 UTC
Read the original article Hit count: 363

Filed under:
|
|

In our own Jon Skeet's C# in depth, he discusses the 3 ways to simulate a 'null' for value types:

  • Magic value (e.g. earliest possible DateTime is taken to be 'null')
  • Reference type wrapper
  • boolean flag

It is mentioned that nullable types use the third method. How exactly do nullable types work under the hood?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#