当前位置:网站首页>左值引用和右值引用
左值引用和右值引用
2022-06-30 20:00:00 【兔云程序】
什么是引用
引用就是给已经存在的变量取得一个别名,而不是新定义一个变量。编译器不会为引用变量开辟新得内存空间,引用变量和引用的变量共用同一内存空间。

引用的规则
引用在定义时必须初始化
一个变量可以有多个引用
引用一旦引用一个实体,不能再引用其它实体
什么是左值,右值
右值引用是C++ 11新增的特性,左值引用从C++ 98就开始有。
目前我们针对C++编程语言。
左值(left-values),缩写:lvalues
右值(right-values),缩写:rvalues
你可以通俗的理解lvalues是指存在于单个表达式之外的对象。你可以把左值当成有名字的对象。
rvalues是一个暂时存在的值存在于单个表达式之内的对象。简单来说,右值就是一个生命周期即将结束的值。也叫将亡值。

以下为官网所写的原理
边栏推荐
- Jerry's determination of detection sensitivity level [chapter]
- What is the difference between tolocal8bit and toutf8() in QT
- 操作系统面试题汇总(不定期更新)
- Jerry's question about long press boot detection [chapter]
- 最新海康摄像机、NVR、流媒体服务器、回放取流RTSP地址规则说明[通俗易懂]
- Exness: liquidity series - liquidity cleaning and reversal, decision interval
- Is the project manager a leader? Can you criticize and blame members?
- Ten percent of the time, the tar command can't parse the English bracket "()" when decompressing the file
- maya房子建模
- Web host iptables firewall security script
猜你喜欢

杰理之触摸按键识别流程【篇】

1、生成对抗网络入门

Implementation principle of PostgreSQL heap table storage engine

Taihu Lake "China's healthy agricultural products · mobile phone live broadcast" enters Taihu Lake

25:第三章:开发通行证服务:8:【注册/登录】接口:接收并校验“手机号和验证码”参数;(重点需要知道【利用redis来暂存数据,获取数据的】的应用场景)(使用到了【@Valid注解】参数校验)

Halcon知识:盘点一下计量对象【1】

Document contains & conditional competition

传输层 使用滑动窗口实现流量控制

Golang应用 ━━ 安装、配置与使用hugo博客系统
Redis ziplist 压缩列表的源码解析
随机推荐
Jerry's touch key recognition process [chapter]
Originpro 2021 with installation tutorial
杰理之关于长按开机检测抬起问题【篇】
Jerry's touch key recognition process [chapter]
Maya House Modeling
静态类使用@Resource注解注入
Installation and use of securecrtportable
Notes on modification of Jerry's test box pairing software [chapter]
Ten percent of the time, the tar command can't parse the English bracket "()" when decompressing the file
Primary school, session 3 - afternoon: Web_ xxe
居家办公没有“血泪史”| 社区征文
Big God explains open source buff gain strategy live broadcast
为什么一定要从DevOps走向BizDevOps?
All the important spark summit features were released here last night (with ultra clear video attached)
SecureCRTPortable的安装和使用(图文详解)
QT :QAxObject操作Excel
CV+Deep Learning——网络架构Pytorch复现系列——basenets(BackBones)(一)
exness:美GDP终值意外加速萎缩1.6%
Basic syntax of VB
TorchDrug--药物属性预测