What is meant by “pr values don’t have identity”, and why does function call returning an object by value not have identity?

The C++ Standard specifies that a pr-value is (among others) “a function call or an overloaded operator expression, whose return type is non-reference”.

Now I wonder why that exactly is the case, because a pr-value is said to be an expression (or evaluation thereoff) that “can be moved from” and “doesn’t have identity”. I’d like to know what the part about the identity specifically means, because as is, I don’t think this is a very satisfactory statement. It is sometimes linked to the object existing in storage, but that part is similarly confusing as well, as I will lay out now:

Let’s say we have a function that passes parameters by value, and returns an object by value:

manipulateB(B objectB) {
//do something with B optionally manipulate it, and then return it by value
return objectB
}

When objectB is returned (either it is still the same object because of copy elision, or instead it copy constructed) in the main function

int main() {
B b = B();
B c = manipulateB(b)
}

then the functioncall “manipulteB(b)” has the value category pr-value, but there is an object of type B in the storage, and that object obviously has identity. It doesn’t yet have a name, but it is already there. It is then either assigned to object c, either via copy assignment, or, when there is copy elision, c is directly initialized with the object in the memory.

Now I wonder, why is it that the function call is a pr-value, despite there being an object in the scope?

There are some points where I think I might have misconcepted something, and I’d like to understand which one (or several) of them is the root für my misunderstanding:

  1. The value-category is a property of the expression “manipulateB(b)” in the code. While there might be an object of type B in the memory after the evaluation of that expression, there is no well defined way of attributing this place in memory to the expression “manipulateB(B objectB)”. Especially, another function call
B d = manipulateB(b)

might yield an other object in memory. The object in the memory will afterwards belong to the expressions “d” and “c”, but not to the expression “manipulateB(b)”. And calling the Address-of operator on “manipulateB(b)” is neither possible, nor meaningful.

  1. At the moment the expression is evaluated, it is not clear if there is an object of type B in the storage at all. After the complete assignment statement has been carried out, there exists an object of type B in the storage that is assigned to the expression b, but this object doesn’t have any ties to the expression “manipulateB(b)”.

  2. The property of a value-category is a rather abstract notion on the level of source code. When it is stated that an expression does have “identity”, then what is meant by that is that an object (that can have internal states) is associated with this expression. Depending on the methods and members of type B, the outcome of any expression involving the expression “b”, “c” or “d” may depend on the state of “b”. Contrary to that, modulo those dependencies, the outcome of “manipulateB(b)” doesn’t depend on anything.

I hope I was able to explain my confusion, and possible ways out of it. Which of the misconceptions that I have outlined is true and the reason why such a function call is not a pr-value?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật