当前位置:网站首页>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 ).
边栏推荐
- What are the common processes of software stress testing? Professional software test reports issued by companies to share
- LeetCode:673. Number of longest increasing subsequences
- vb.net 随窗口改变,缩放控件大小以及保持相对位置
- UML diagram memory skills
- After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
- C language double pointer -- classic question type
- [OC]-<UI入门>--常用控件-UIButton
- 【嵌入式】Cortex M4F DSP库
- Crash problem of Chrome browser
- 目标检测——Pytorch 利用mobilenet系列(v1,v2,v3)搭建yolov4目标检测平台
猜你喜欢

UML diagram memory skills

Light of domestic games destroyed by cracking
![[embedded] cortex m4f DSP Library](/img/83/ab421d5cc18e907056ec2bdaeb7d5c.png)
[embedded] cortex m4f DSP Library

UML图记忆技巧

View computer devices in LAN

MySQL uninstallation and installation methods

swagger设置字段required必填

Sublime text using ctrl+b to run another program without closing other runs

vb. Net changes with the window, scales the size of the control and maintains its relative position

TP-LINK enterprise router PPTP configuration
随机推荐
LeetCode:41. 缺失的第一个正数
目标检测——Pytorch 利用mobilenet系列(v1,v2,v3)搭建yolov4目标检测平台
Leetcode: Sword finger offer 42 Maximum sum of continuous subarrays
Leetcode: Sword Finger offer 42. Somme maximale des sous - tableaux consécutifs
LeetCode:剑指 Offer 48. 最长不含重复字符的子字符串
LeetCode:236. 二叉树的最近公共祖先
LeetCode:221. Largest Square
Pytorch view tensor memory size
[OC]-<UI入门>--常用控件的学习
项目连接数据库遇到的问题及解决
[MySQL] limit implements paging
Analysis of the source code of cocos2d-x for mobile game security (mobile game reverse and protection)
[NVIDIA development board] FAQ (updated from time to time)
LeetCode:214. 最短回文串
R language ggplot2 visualization, custom ggplot2 visualization image legend background color of legend
[OC-Foundation框架]--<Copy对象复制>
TP-LINK enterprise router PPTP configuration
TP-LINK 企业路由器 PPTP 配置
C language double pointer -- classic question type
Indentation of tabs and spaces when writing programs for sublime text