I'm having difficulty updating map objects. In the code I've
excerpted below, I store map objects without difficulty, but my attempts
to modify elements of the stored data don't work.
struct ChipRecord // Chip Times record
{
time_t hiStartTime; // Start Time
// much more...
} timeWork; // entrant info records
typedef map<int, ChipRecordBCI;
BCI bci;
map<int, ChipRecord>::it erator bIter;
int nBib = 17;
time_t cTime = 11151544;
// initialize and populate "timeWork" structure, etc.
bci.insert(bci: :value_type(bib Number, timeWork));
//...
// obtain a cTime value...
bIter = bci.find(nBib);
if(bIter != bci.end())
{
timeWork = bIter->second; // ???
timeWork = bci.find(nBib)->second; // ???
timeWork = (*bIter).second ; // ???
if(cTime timeWork.hiStar tTime) // use highest time
{ // update the object
bIter->second.hiStart Time = cTime; // ???
timeWork.hiStar tTime = cTime; // ???
} // if
} // if
It's the code directly above that doesn't do what I intend: change
the map object's value and update the object. There is much more going
on in the program, but this is the simplest amount that demonstrates the
issue. I don't know how to update the object. Please advise. TIA
excerpted below, I store map objects without difficulty, but my attempts
to modify elements of the stored data don't work.
struct ChipRecord // Chip Times record
{
time_t hiStartTime; // Start Time
// much more...
} timeWork; // entrant info records
typedef map<int, ChipRecordBCI;
BCI bci;
map<int, ChipRecord>::it erator bIter;
int nBib = 17;
time_t cTime = 11151544;
// initialize and populate "timeWork" structure, etc.
bci.insert(bci: :value_type(bib Number, timeWork));
//...
// obtain a cTime value...
bIter = bci.find(nBib);
if(bIter != bci.end())
{
timeWork = bIter->second; // ???
timeWork = bci.find(nBib)->second; // ???
timeWork = (*bIter).second ; // ???
if(cTime timeWork.hiStar tTime) // use highest time
{ // update the object
bIter->second.hiStart Time = cTime; // ???
timeWork.hiStar tTime = cTime; // ???
} // if
} // if
It's the code directly above that doesn't do what I intend: change
the map object's value and update the object. There is much more going
on in the program, but this is the simplest amount that demonstrates the
issue. I don't know how to update the object. Please advise. TIA
Comment