|
|
Darren New <dne### [at] sanrrcom> wrote:
> On 7/2/2011 13:52, Warp wrote:
> > What does X.Value return if X.HasValue is false?
> Oh, and for what it's worth, "X = null;" does the same as setting
> "X.HasValue=false" and "X == null" is the same as "!X.HasValue". Just
> syntactic sugar the compiler puts in during one of the very early passes.
> Not something easy to do with C++ just that way, I suspect?
I suppose you could add an assignment and comparison operator to the
'Nullable' class that takes a void* as parameter, and which set the
'mHasValue' to false if that parameter is null. (An interesting question
is what should happen if the parameter is not null.)
--
- Warp
Post a reply to this message
|
|