• tunetardis@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    Afaik every modern compiler does NRVO and manually moving prevents it.

    Yeah this is what bothers me. std::move could make things worse, but not if the alternative is a copy. But you’re probably right that any self-respecting compiler nowadays would do NRVO.