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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -