logoalt Hacker News

leni536today at 3:15 PM1 replyview on HN

That one is not too hard either. `one` simply can't be NRVO'd as there is a runtime path in scope of it that doesn't return it. `two` can be (unless you hide some other return within ...).


Replies

bluGilltoday at 4:47 PM

You can structre the code differently to get around that. There is a real desire to use NRVO "one" in cases when it is returned as well, if possible.