I was recently working on a C++/CLI project (which I only rarely do, as you'll soon find out)where there was a need to have a method returning a nullable DateTime.
I look up Nullable in the help, I see "ref class Nullable", think that the following will do it.
Nullable<DateTime>^ GetStuff();
I take a look once again and find out that Nullable<T> is "public value class", so the correct incantation should have been:
oh, and to return a null value you just do:Nullable<DateTime> GetStuff();
return Nullable<DateTime>();
1 comment:
Post a Comment