Trouble with inheritance of operator= in C++

前端 未结 5 1551
灰色年华
灰色年华 2020-11-27 04:20

I\'m having trouble with the inheritance of operator=. Why doesn\'t this code work, and what is the best way to fix it?

#include 

class A
{
         


        
5条回答
  •  萌比男神i
    2020-11-27 04:55

    (Probably not a fix & probably not what you should do) BUT... there's a way you can force the issue if you really must:

     (A&)(*(&b)) = (A&)(*(&c))
    

提交回复
热议问题