im using simple vector push_back to object of Type A and getting this error , this is my code :
class A
{
public:
A(int a,int b,int c);
};
#include "A.h"
....
....
....
....
std::vector<A>* vec_objects = new std::vector<A>();
while(....some condition ...)
{
A a(1,2,3)
vec_objects->push_back(a);
}
getting this error:
c:\program files\microsoft visual studio 9.0\vc\include\xutility(3159) : error C2582: 'operator =' function is unavailable in 'A'
1> c:\program files\microsoft visual studio 9.0\vc\include\xutility(3187) : see reference to function template instantiation 'void std::_Fill<A*,_Ty>(_FwdIt,_FwdIt,const _Ty &)' being compiled
1> with
1> [
1> _Ty=A,
1> _FwdIt=A *
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\include\vector(1231) : see reference to function template instantiation 'void std::fill<A*,_Ty>(_FwdIt,_FwdIt,const _Ty &)' being compiled
1> with
1> [
1> _Ty=A,
1> _FwdIt=A *
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\include\vector(1153) : while compiling class template member function 'void std::vector<_Ty>::_Insert_n(std::_Vector_const_iterator<_Ty,_Alloc>,unsigned int,const _Ty &)'
1> with
1> [
1> _Ty=A,
1> _Alloc=std::allocator<A>
1> ]
1>
what i did wrong ?