繁体   English   中英

这三个构造函数有什么区别?

[英]what is the difference between these three constructors?

List(); 

List( List const & ); 

List( List && ); 

请告诉我这三个构造函数之间的区别(特别是最后两个)? 实际上我在 List & 和 List && 之间感到困惑? &和&&有什么区别

从上到下:

默认构造函数

List(); 

复制构造函数(其中const &表示它需要 const 左值引用):

List( List const & ); 

移动构造函数(其中&&意味着它需要非常量右值引用):

List( List && );

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM