▲ 28 ▼ On harmful overuse of std::move - The Old New Thing (devblogs.microsoft.com) submitted 2 years ago by lysdexic@programming.dev [M] to c/cpp@programming.dev 22 comments fedilink hide all child comments
[–] BatmanAoD@programming.dev 3 points 2 years ago (2 children) ...which is also explicit. permalink fedilink source parent hideshow 4 child comments replies: [–] wosrediinanatour@mastodon.social 2 points 2 years ago (1 child) @BatmanAoD @Miaou It is just what you are used to. In C++ everything is a copy. Sometimes the compiler optimizes it away. clang-tidy may help. Having a clone() is very C-like. permalink fedilink source parent hideshow 2 child comments replies: [–] Miaou@jlai.lu 1 point 2 years ago* (last edited 2 years ago) That's a common idiom but the default behaviour is still implicit copy, which, with VLAs and no smart pointers, makes things arguably worse than in c++ permalink fedilink source parent [–] Miaou@jlai.lu 1 point 2 years ago I thought that was obvious as I mentioned a function call, but yes indeed permalink fedilink source parent
[–] wosrediinanatour@mastodon.social 2 points 2 years ago (1 child) @BatmanAoD @Miaou It is just what you are used to. In C++ everything is a copy. Sometimes the compiler optimizes it away. clang-tidy may help. Having a clone() is very C-like. permalink fedilink source parent hideshow 2 child comments replies: [–] Miaou@jlai.lu 1 point 2 years ago* (last edited 2 years ago) That's a common idiom but the default behaviour is still implicit copy, which, with VLAs and no smart pointers, makes things arguably worse than in c++ permalink fedilink source parent
[–] Miaou@jlai.lu 1 point 2 years ago* (last edited 2 years ago) That's a common idiom but the default behaviour is still implicit copy, which, with VLAs and no smart pointers, makes things arguably worse than in c++ permalink fedilink source parent
[–] Miaou@jlai.lu 1 point 2 years ago I thought that was obvious as I mentioned a function call, but yes indeed permalink fedilink source parent