Should copy assignment operator pass by const reference or by value?
问题 Prior to C++11, it has always been the case that copy assignment operator should always pass by const reference, like so: template <typename T> ArrayStack<T>& operator= (const ArrayStack& other); However, with the introduction of move assignment operators and constructors, it seems that some people are advocating using pass by value for copy assignment instead. A move assignment operator also needs to be added: template <typename T> ArrayStack<T>& operator= (ArrayStack other); ArrayStack<T>&