标签: c++ constructor reference
考虑C ++标准12.6.2 / 11中的以下片段:
struct A { A() = default; // OK A(int v) : v(v) { } // OK const int& v = 42; // OK }; A a1; // error: ill-formed binding of temporary to reference A a2(1); // OK, unfortunately
他们为什么说A a2(1);不好?有什么问题?
A a2(1);