Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure if C++14 or C++17 has fixed this but if the object was not copy-constructible then the compiler would emit an error if it was returned by value even if RVO/NRVO was meant to be used. I figure because semantically you need to enable copy-construction of the object.


IIRC it was changed in C++14. Now in the RVO case, no copy/move constructor is required (and in fact the compiler is not allowed to call it if it exists).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: