can’t use default assignment operator
class A { public: float x; A(): x(0) {} }; std::vector av; A a; av.push_back( a );
했을 때,
can’t use default assignment operator
와 같은 error가 발생한다면,
class A 에 다음 형식의 assignment operator가 정의되어 있지 않아서이다.
A& operator=( const A& a ) { x = A.x; return (*this); }
container의 객체로 사용하려면 반드시 assignment operator가 정의되어 있어야 한다.