是否有布尔之间有什么区别?并且可空&LT;布尔&GT;? [英] Is there any difference between bool? and Nullable<bool>?
本文介绍了是否有布尔之间有什么区别?并且可空&LT;布尔&GT;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C#中是可空原始类型(即布尔
?)只是别名,其对应的可空&LT; T&GT;
类型或是两者之间有区别吗?
In C# are the nullable primitive types (i.e. bool?
) just aliases for their corresponding Nullable<T>
type or is there a difference between the two?
推荐答案
如果你看一下IL使用的 ILDASM ,你会发现,他们都可以编译为可空&LT;布尔&GT;
If you look at the IL using Ildasm, you'll find that they both compile down to Nullable<bool>
.
这篇关于是否有布尔之间有什么区别?并且可空&LT;布尔&GT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文