= default和没有参数的空构造函数之间的区别? [英] Difference between =default and empty constructor with no arguments?
本文介绍了= default和没有参数的空构造函数之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
= default和没有参数的空构造方法之间的区别?
Difference between =default and empty constructor with no arguments?
之间是否存在差异:
MyClass() {}
MyClass() = default;
推荐答案
总体没有。 ;)
它的整体效果相同,但不完全相同(就像sftrabbit,Nawaz和0x499602D2所建议的一样,谢谢)。
It will do overall the same, but not exactly (like sftrabbit, Nawaz, and 0x499602D2 suggest it, thanks by the way).
您将找到问题的答案这里;)
You will find an answer to your question here ;)
这篇关于= default和没有参数的空构造函数之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文