#include <vector>
using namespace std;
struct A
{
A(const vector<int>&) {}
A(vector<int>&&) {}
};
A f()
{
vector<int> coll;
return A{ coll }; // Which constructor of A will be called as per C++11?
}
int main()
{
f();
}
Is coll
an xvalue
in return A{ coll };
?
Does C++11 guarantee A(vector<int>&&)
will be called when f
returns?