M
Mike Copeland
How does one use std:less? Specifically, I have a declaration as
follows:
struct ChipRecord // Chip Times record
{
int bibNum; // Bib #
long lowStartTime; // Start Time
long hiStartTime; // Start Time
long gunTime; // Gun Time, if needed
long lowFinishTime; // Start Time
long hiFinishTime; // Start Time
long netTime; // computed "net" Finish Time
string entName; // Entrant Name
string chipId;
string ctsKey; // City/State abbreviation key
short entAge; // Age
char entSex; // Sex code (M/F)
char entRCode;
} timeWork; // entrant info record
typedef map<string, ChipRecord> CHIPINFO;
CHIPINFO chipInfo;
map<int, ChipRecord>::iterator cIter;
In the above, the "index" to the objects is numeric (bibNum), and I
wish to assure that (1) no duplicates are stored and (2) I could produce
an ordered listing of all stored data. Since sorting an STL map seems
overly difficult, is there some way to use the std::less option somehow
to get the data stored sequentially?
If so, how do I use this option? If not, what might I do? TIA
follows:
struct ChipRecord // Chip Times record
{
int bibNum; // Bib #
long lowStartTime; // Start Time
long hiStartTime; // Start Time
long gunTime; // Gun Time, if needed
long lowFinishTime; // Start Time
long hiFinishTime; // Start Time
long netTime; // computed "net" Finish Time
string entName; // Entrant Name
string chipId;
string ctsKey; // City/State abbreviation key
short entAge; // Age
char entSex; // Sex code (M/F)
char entRCode;
} timeWork; // entrant info record
typedef map<string, ChipRecord> CHIPINFO;
CHIPINFO chipInfo;
map<int, ChipRecord>::iterator cIter;
In the above, the "index" to the objects is numeric (bibNum), and I
wish to assure that (1) no duplicates are stored and (2) I could produce
an ordered listing of all stored data. Since sorting an STL map seems
overly difficult, is there some way to use the std::less option somehow
to get the data stored sequentially?
If so, how do I use this option? If not, what might I do? TIA