当前位置:网站首页>What is an R-value reference and what is the difference between it and an l-value?
What is an R-value reference and what is the difference between it and an l-value?
2022-07-06 08:51:00 【it_ xiangqiang】
Right value reference and left value reference
- Right quoting
- The concepts of left and right values :
- The difference between right and left references :
Right quoting
The right quotation is C++11 New features introduced in , It implements transfer semantics and precise delivery . Its main
The purpose has two aspects :
- Eliminate unnecessary copy of objects when two objects interact , Save computing and storage resources , Increase of efficiency .
- Can be more concise and clear definition of generic functions .
The concepts of left and right values :
The left value : Can take address for expression 、 Or named objects / Variable . A persistent object that still exists after the end of an expression .
Right value : Cannot address an expression , Or anonymous objects . A temporary object that no longer exists at the end of an expression .
The difference between right and left references :
- Left values can address , And right value can't .
- Left values can be assigned , Right values cannot be assigned , It can be used to assign values to left values .
- Left variable , The right value is immutable ( For foundation types only , The right value reference of user-defined type can be through member function
change ).
边栏推荐
- ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
- Using C language to complete a simple calculator (function pointer array and callback function)
- 【剑指offer】序列化二叉树
- View computer devices in LAN
- Philosophical enlightenment from single point to distributed
- swagger设置字段required必填
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Target detection - pytorch uses mobilenet series (V1, V2, V3) to build yolov4 target detection platform
- Niuke winter vacation training 6 maze 2
- Hutool gracefully parses URL links and obtains parameters
猜你喜欢

MySQL uninstallation and installation methods

Crash problem of Chrome browser

JVM quick start

Alibaba cloud server mining virus solution (practiced)

View computer devices in LAN

UnsupportedOperationException异常

Deep analysis of C language data storage in memory

Compétences en mémoire des graphiques UML

Cesium draw points, lines, and faces

【剑指offer】序列化二叉树
随机推荐
The problem and possible causes of the robot's instantaneous return to the origin of the world coordinate during rviz simulation
注意力机制的一种卷积替代方式
软件压力测试常见流程有哪些?专业出具软件测试报告公司分享
How to effectively conduct automated testing?
企微服务商平台收费接口对接教程
Double pointeur en langage C - - modèle classique
Revit 二次开发 HOF 方式调用transaction
LeetCode:41. 缺失的第一个正数
poi追加写EXCEL文件
LeetCode:836. Rectangle overlap
LeetCode:387. 字符串中的第一个唯一字符
可变长参数
MYSQL卸载方法与安装方法
LeetCode:387. The first unique character in the string
vb. Net changes with the window, scales the size of the control and maintains its relative position
pytorch查看张量占用内存大小
有效提高软件产品质量,就找第三方软件测评机构
[OC]-<UI入门>--常用控件-UIButton
[OC-Foundation框架]--<Copy对象复制>
[today in history] February 13: the father of transistors was born The 20th anniversary of net; Agile software development manifesto was born