Implicit sharing was one of the reasons I asked the question. I was 90% sure that returning const& is bad because that variable is on stack. One you return from function that stack memory is marked as free and something will overwrite the variable whose reference I returned. Thanks for the quick reply.




Reply With Quote
Bookmarks