samedi 24 mars 2018

Why does it uses the term "object" here when mentioning a prvalue?

As far as I know,in c++17 the concept of prvalue is no longer temporary object,so in many circumstances the copy elision is mandated.

However, today I came cross a description of return expression

If expression is a prvalue, the object returned by the function is initialized directly by that expression. This does not involve a copy or move constructor when the types match

Why does the term object occurs here? In value category the return of function which is not a reference type belongs to prvalue,so I think maybe it is inappropriate to use the term object.

From my point of view,the prvalues are no longer objects now,they are just values,am I right?

Aucun commentaire:

Enregistrer un commentaire