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.
您声明了一个需要非const左值的复制构造函数。但是,fun()返回一个临时值,您不能将一个临时值绑定到非const左值。您可能希望将复制构造函数声明为
const
fun()
Test(Test const& t) { ... }