What exactly is an R-Value in C++?

前端 未结 3 1596
故里飘歌
故里飘歌 2020-12-05 07:19

Could someone explain, or point me to some sort of explanation, of what R-Value is? I\'m not really sure what it is, and my project has to incorporate it. Here is a demonstr

3条回答
  •  -上瘾入骨i
    2020-12-05 07:30

    Rvalue & Lvalue

    Before Explaining This two notation let's Check what is Called Movable and Identity

    Identity:- In short anything that has name & we can point to or Reference to know that whether it is same value or Different Value

    Moving:- In short anything whose content can be moved from one place or Memory to Other

    Lvalue are those value that has Identity so we can point to it or Reference it, but cannot Move it These are called Classical Values

    Rvalue are one that are movable (whether has identity or not) these contains temporary values or ADT that support move

提交回复
热议问题