Original Post
I am wondering if I am using the stl lists correctly. I have the class Batt_List wrapped around the list. I use this method to retrieve an element from the list, for what Im thinking should be read/write. Batts are the objects stored in the list. I use it in this fashion. This works fine to extract info from the list, but I cannot change the data of the Batt object that is in the list. I dont know if Im confusing myself with pointers or if I have a bug somewhere else.
//GetBattByID()
bool Batt_List::GetBattByID(int _param,Batt& battRef)
{
//Check for a size of zero.
if(GetSize() == 0) return false;
//Check if unit is in list, set reference if so.
for(iter = battList.begin(); iter != battList.end(); iter++)
{
//Set element if its in the list.
if(iter->GetBattID() == _param) battRef = *iter;
}//end for
return true;
}
//GetBattByID()
Batt temp;
//getting the first object in the list for example
listObject.GetBattByID(0,temp);
//Change the data in temp here.