Has anyone found the need to declare the return parameter of a copy assignment operator const?

Posted by Keith on Stack Overflow See other posts from Stack Overflow or by Keith
Published on 2010-04-15T21:20:43Z Indexed on 2010/04/15 21:23 UTC
Read the original article Hit count: 114

Filed under:
|

The copy assignment operator has the usual signature:

    my_class & operator = (my_class const & rhs);

Does the following signature have any practical use?

    my_class const & operator = (my_class const & rhs);

You can only define one or the other, but not both.

© Stack Overflow or respective owner

Related posts about c++

Related posts about assignment-operator