The following question arose: how does std :: move work from the point of view of linking together?

The question arose in connection with the passage of the course on the platform stepic - "Programming in C ++ (continued)"

Clarification: the subsequent question and its “not usefulness” in the eyes of the SO community does not reflect in any way the desire of the author of the question “not to understand the question” or the attitude of a non-issue in its formation. This question was asked in accordance with the materials of the aforementioned course and can in no way be more informative than the last.

How does std :: move behave with rvalue and lvalue links? enter image description here

Closed due to the fact that the essence of the question is not clear to the participants of Abyx , LFC , freim , mkkik , aleksandr barakin 22 Apr at 15:48 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    What does link glue mean? - VTT
  • @VTT, added an example image - BadCatss 6:03 pm
  • 2
    Ok, but what about std::move ? - VTT
  • 2
    Unlike pointers, there is no link to a link. Therefore, T & & must be something meaningless. Therefore, we recorded T &&. T && is T &, where the compiler clearly hints that the T object is not needed after the function is executed, it can be broken. It turns out that T && is German to the compiler, that T can be broken, and the function void foo (T && t), after execution, will break t. T &&&, T && && etc. does not make sense and should not be compiled. std :: move accepts T & (a reference to an object that, according to the compiler, cannot be broken), and returns T && (a reference to an object that can be broken). He can't do anything else - Dmitry Zinenko
  • five
    @ Dmitry Zinenko Your comment is a complete nonsense. - VTT

1 answer 1

No std::move is an unconditional conversion of any type to an rvalue reference. To do this, there is a "cleaning" of the incoming type from referency, followed by "imposing" && .