vendredi 24 mai 2019

Why a function call is an xvalue (if return type is an rvalue)?

Let's say we have a function:

struct A {
    int m;
};

A&& f();

As far as I know the expressions:

f();
f().m; 

are both xvalue. But why? Why aren't they prvalue? I'm a little bit confused.

Aucun commentaire:

Enregistrer un commentaire