vendredi 24 février 2017

Is a data member of a temporary object an xvalue in C++11?

#include <vector>

using namespace std;

struct A
{
    vector<int> coll;
};

void f(const vector<int>&){}
void f(vector<int>&&){}

int main()
{
    f(A().coll); // Is "A().coll" an xvalue? 
}

Does C++11 guarantee f(A().coll) will call void f(vector<int>&&)?

Aucun commentaire:

Enregistrer un commentaire