#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();
}
是coll
一个xvalue
吗return A{ coll };
?
A(vector<int>&&)
返回时是否会调用C++11 保证f
?