Namespaces
Variants
Views
Actions

Talk:cpp/utility/move

From cppreference.com

Search result don't show this page, only this - algorithm.move. Can it be corrected somehow? Ruslo 02:36, 24 August 2013 (PDT)

You're right, that's a bug. There is some discussion about it in the Main Page Talk section titled Search for "remove" does not show the C++ algorithm.
Unrelated question: for what does "incorrect operation" mean (i.e. undefined behavior, unspecified behavior, etc.)? For what types is this true? I'm having trouble finding evidence to support this claim. http://stackoverflow.com/questions/9322174/move-assignment-operator-and-if-this-rhs suggests that there is nothing in the standard that forbids self-move assignment. --Nate 14:23, 24 August 2013 (PDT)
It's true for C++ standard library, 17.6.4.9 Function arguments [res.on.arguments]. Quotes: "implementation may assume", "impelemtation is free to optimize". (User, of course, can provide correct behaviour by implementing check in custom 'operator=(&&)') Ruslo 02:20, 25 August 2013 (PDT)
How about: "in stl containers case, result is implementation dependent and not guarantee to be correct"? I've file a bug to libc++ to support debug check in this situation, hope this gave some clarification http://llvm.org/bugs/show_bug.cgi?id=16993 Ruslo 02:20, 25 August 2013 (PDT)
Discussion of self-move-assignment, if one is necessary, really belongs to move assignment operator. --Cubbi 08:31, 25 August 2013 (PDT)
Agreed. --Nate 11:09, 25 August 2013 (PDT)
Ok, I've write here Ruslo 13:56, 25 August 2013 (PDT)