Move constructor vs. Move assignment
问题 As an extension to This question, i am trying to get my move assignment correct. I have the following code: // copy assignment operator LinkedList<T>& operator= (LinkedList<T> other) noexcept { swap(*this, other); return *this; } // move assignment operator LinkedList<T>& operator= (LinkedList<T>&& other) noexcept { swap(*this, other); return *this; } But when i try to use it, my code fails to compile. First some code: LinkedList<int> generateLinkedList() { LinkedList<int> List; List.add(123)