[ell-i-developers] Re: Register Assignment Operator (operator = )

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Wed, 20 Aug 2014 08:51:19 +0300

> I remember we had a brief discussion about why it is necessary to 
> define the assignment operator in every class that inherits Register
> https://github.com/Ell-i/Runtime/blob/master/stm32/emulator/inc/Register.h#L56
> Why it does not behave as the other inherited operators?

Excellent question!  

> I think this is quite related:
> http://www.learncpp.com/cpp-tutorial/911-the-copy-constructor-and-overloading-the-assignment-operator/
> //----

After some googling, this seems to be the most relevant answer I was able to 


Hence, it looks like that we actually *can* avoid rewriting the operator over 
and over through the "using" declaration, as discussed in the referred page.  
(BTW, this was all new to me -- thanks for making me to learn new things. :-)

Feel free to explore and provide a pull request!


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Other related posts: