I have a problem(compiling problem) in my code. I would be happy if you can explain to me why this is happening and how I can fix it.
the error -
error C2512: 'Item': no appropriate default contractor available
*Item is a set
The line where this error happened not in my code, the problem in file called tuple but in my code the problem shows when I do this -
void init(map <int, Item>& itemli)
{
Item temp("ro","1",1,1.99);
itemli[1] = (temp);
temp.setName("bo");
temp.setSerialNumber("2");
temp.setUnitPrice(2.22)
// And so it goes on ...
}
My contractor -
Item::Item(string name,string serialNumber,int count, double unitPrice)
{
_name = name;
_serialNumber = serialNumber;
_count = count;
_unitPrice = unitPrice;
}
Thanks for the help !