News for hackers. Stuff that matters.
Re:You can't Rust that by saagarjha on Saturday March 31, 2018 @02:45PM (#16724524)
> C++ probably moves things around more than rust

I don't think so, actually. As far as I'm aware moves are only done when explicitly asked for, because any implicit move would have the consequence of breaking references and being unsafe in general if you're not careful.

Re:You can't Rust that by wilun on Saturday March 31, 2018 @07:47PM (#16725803)
> As far as I'm aware moves are only done when explicitly asked for

Certainly not. Move are attempted (in the sense that the move constructor/operator= will be called if it exists) from rvalue references. Those are for example all temporaries. That has let accelerate all C++ programs using std objects by simply recompiling them (with the new versions of the objects supporting the move while it did not exist in the old versions)

Re:You can't Rust that by saagarjha on Saturday March 31, 2018 @07:55PM (#16725828)
Well, it makes sense to move temporaries. There's no point in copying them again if the original won't be used.
Re:You can't Rust that by jcelerier on Sunday April 01, 2018 @10:15AM (#16728378)
> As far as I'm aware moves are only done when explicitly asked for

no, every time you have a function returning a temporary you can have a move, e.g.

    std::vector<int> myfun();
    
    struct myclass { myclass(std::vector<int> v); };
here if you do

    myclass c{myfun()}; 
there can be a move