How to use Nullable types in c++/cli?

浪尽此生 提交于 2019-11-30 03:12:50

OK, found it, after a lot of hassle:

to return null, just do

return Nullable<double>();

to return non-null:

return Nullable<double>(12321);

It is important to declare the return value as Nullable<double> and not Nullable<double>^, as if you do it, when using other languages as C# and vb.net, you'll see the type as ValueType instead of double?.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!