错误'operator =' function is unavailable in 'A'
// testCreate.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class A
{
public:
A():i(2)
{
printf("A is create\n");
}
~A()
{
printf("A is destroyed\n");
}
const int i;
};
A& createA(A &a)
{
A b;
return b;
}
int main(int argc, _TCHAR* argv[])
{
A a;
a=createA(a);
return 0;
}
编译总是报错:error C2582: 'operator =' function is unavailable in 'A'
请大家看看什么原因