主流机i5还是Ryzen 5?# Hardware - 计算机硬件
c*e
1 楼
这个const_cast什么意思?是说a不是常数了吗?
const_cast(a) = other.a;
*****************
class A{
const int a;
public:
A():a(0){};
A(int m_a):a(m_a){};
A& operator =(const A &other);
};
A & A::operator =(const A &other)
{
const_cast(a) = other.a;
return *this;
}
const_cast
*****************
class A{
const int a;
public:
A():a(0){};
A(int m_a):a(m_a){};
A& operator =(const A &other);
};
A & A::operator =(const A &other)
{
const_cast
return *this;
}