lysdexic@programming.devM to C++@programming.devEnglish · 10 months agoOn harmful overuse of std::move - The Old New Thingdevblogs.microsoft.comexternal-linkmessage-square11fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkOn harmful overuse of std::move - The Old New Thingdevblogs.microsoft.comlysdexic@programming.devM to C++@programming.devEnglish · 10 months agomessage-square11fedilink
minus-squareporgamrer@programming.devlinkfedilinkarrow-up0·10 months agoTo me it’s not really excitement so much as “oh god how do i make this ridiculous language do the correct thing”. I’m way more scared of rogue implicit copy constructors. I wonder if cppfront has any plan to fix problems like implicit copy and pessimising move.
minus-squarecrispy_kilt@feddit.delinkfedilinkarrow-up0·10 months agoIn Rust, making something copyable is always explicit. I like that a lot.
minus-squareMiaou@jlai.lulinkfedilinkarrow-up0·10 months agoCopy has a very different meaning between the two languages. In rust the equivalent of a c++ copy is a clone() call for anything non trivial
minus-squareFlorian Xaver@mastodon.sociallinkfedilinkarrow-up1·10 months ago@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.
minus-squareSpecialpatrol@feddit.uklinkfedilinkarrow-up0arrow-down1·10 months agoCpp should have done ref by default and had & for copy, but here we are.
To me it’s not really excitement so much as “oh god how do i make this ridiculous language do the correct thing”.
I’m way more scared of rogue implicit copy constructors. I wonder if cppfront has any plan to fix problems like implicit copy and pessimising move.
In Rust, making something copyable is always explicit. I like that a lot.
Copy has a very different meaning between the two languages. In rust the equivalent of a c++ copy is a clone() call for anything non trivial
…which is also explicit.
@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.
Cpp should have done ref by default and had & for copy, but here we are.