After compiling with
g ++ Copy.cpp -std = C ++ 11 -fno-elide-constructors
Exit:
Def constr
Copy Constr
Copy Constr
And my questions: why 2 Copy Constr? I thought that only 1 copy is required.
Perhaps I have an assumption that func1 () throws a temporary object, and this temp object needs to be copied to another memory area and from this region again make a copy for the func2 () parameter, but this is uncertain for me.
Could you explain this in detail?
c ++ c ++ 11 copy-elision
Oleg
source share