I am having a problem trying to load a map that has another map/vector combination as the value with structs. Below is my code which I have tried to simplify as much as I could:
//These are the structs
struct Order
{
std::string A;
std::string B;
};
struct Card
{
std::string C;
std::string D;
};
struct Item
{
std::string E;
std::string F;
};
//this is the method that will read and load the map
void LoadMap(ListofValues object)
{
std::map<Order, std::map<Item, std::vector<Card>>> records; //THIS is the data structure I'm trying to store into
//ListofValues is a list passed that holds all these values that will need to be put into my map
for(std::vector<ListofValues>::iterator vIter= object.begin(); vIter != object.end(); ++vIter)
{
std::string sReceiptRecord = (*vIter).getReceipt(m_StdOrderConfirmVer);
Order order = {(*vIter).getA,(*vIter).getB};
Item item = {(*vIter).getC,(*vIter).getD};
Card card = {wws::String((*vIter).getE), (*vIter).getF};
records[order][item].push_back(card); //load into my map
}
}
So I will have an object passed that contains a list of all the values (ListofValues). I will iterate through that list and with the getter methods, I will store those values into the structs (getE returns a Long which is why the conversion was necessary). Is there a step I'm missing
An error I'm getting is:
error C2678: binary '<' : no operator found which takes a left-hand operand of type 'const Order' (or there is no acceptable conversion)