• tunetardis@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    That’s fascinating.

    NVRO being optional annoys me. I’m always debating whether I should std::move the return value just in case, but if the compiler performs NVRO (which it probably does), this may be a pessimization right? Ugh.

    • perivesta@feddit.de
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 year ago

      I think you should never std::move return values. Afaik every modern compiler does NRVO and manually moving prevents it. And on the offchance you need to use a compiler that optimizes less, that one copy most likely is the least of the performance concerns.