c++ - Does returning by const value affect return value optimization? -


consider function

const std::string f() {     return "hello"; } 

and call

std::string x = f(); 

regardless of whether value return types should const or not, fact return value const, prevent compiler performing return value optimization?

my understanding of rvo returned object constructed directly variable outside function. however, if return type const t, isn't same t, rvo prevented?


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

single sign on - Logging into Plone site with credentials passed through HTTP -