Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,
struct A {}; struct B { B(A&& a) : mA(std::move(a)) // Is A's constructor called here? {} A&& mA; };
A的初始化列表中是否调用了 的构造函数B?或者它就像一个指针实现的引用?
A
B
不; mA不是一个对象,而只是一个引用,所以没有什么可以构造的。
mA