Okay so inside my ArcherArmor.cpp, I'm trying to figure out why the map initializer list isn't working, but for some reason I keep getting "Error C2593: 'operator =' is ambiguous". Here is my code:
I also have a class which ArcherArmor is derived from, that has a struct called Armor
, which I left out for simplicity. The main problem is that error! The only thing I can think of is that im initializing the map wrong.
//ArcherArmor.h
#include <string>
#include <map>
class ArcherArmor
{
private:
map <int, Armor> soldier_armor;
public:
void ArcherArmor_shop();
};
//ArcherArmor.cpp
#include "ArcherArmor.h"
void ArcherArmor::ArcherArmor_shop(){
soldier_armor = {//name, damage, price
{1, Armor("Meito Ichimonji", 4, 150, 1)},
{2, Armor("Shusui", 10, 230, 2)},
{3, Armor("Apocalypse", 16, 300, 3)},
{4, Armor("Blade of Scars", 24, 550, 4)},
{5, Armor("Ragnarok", 32, 610, 5)},
{6, Armor("Eternal Darkness", 40, 690, 6)},
{7, Armor("Masamune", 52, 750, 7)},
{8, Armor("Soul Calibur", 60, 900, 8)}
};
}
//Main.cpp
/*code left our for simplicity*/