I
indushekara
Hi,
I want to know what is the problem with this code. I am trying to insert in
a map<int,A> where in i have defined the copy constructor for A
I get the following error in VS6.
e:\program files\microsoft visual studio\vc98\include\utility(21) : error
C2558: class 'A' : no copy constructor available
e:\program files\microsoft visual studio\vc98\include\utility(21) :
while compiling class-template member function '__thiscall std:air<int
const ,class A>::std:air<int const ,class A>(const int &,const class A &)'
#pragma warning(disable:4786)
#include <map>
using namespace std;
class A{
public:
A::A(){};
A::A(A& a){};
};
int main()
{
map<int,A> mapA;
A A1;
mapA.insert(map<int,A>::value_type(1,A1));
return 0;
}
tfh
Ishekara
I want to know what is the problem with this code. I am trying to insert in
a map<int,A> where in i have defined the copy constructor for A
I get the following error in VS6.
e:\program files\microsoft visual studio\vc98\include\utility(21) : error
C2558: class 'A' : no copy constructor available
e:\program files\microsoft visual studio\vc98\include\utility(21) :
while compiling class-template member function '__thiscall std:air<int
const ,class A>::std:air<int const ,class A>(const int &,const class A &)'
#pragma warning(disable:4786)
#include <map>
using namespace std;
class A{
public:
A::A(){};
A::A(A& a){};
};
int main()
{
map<int,A> mapA;
A A1;
mapA.insert(map<int,A>::value_type(1,A1));
return 0;
}
tfh
Ishekara