|
From: Ben H. <bh...@al...> - 2001-04-21 23:11:57
|
Unless i am forgetting something basic (very possible, i do this for fun :),
enum exileKeys {
cBoost = "Boosts",
cSeeks = "Seeks"
};
is illegal.
However, we can do:
const char * exileKeys = (
"Boosts",
"Seeks",
"Cadded By",
"Outgoing Share [Time]",
"Incoming Share [Time]",
"Coins To",
"Coins From",
"Times Chained By",
"Times Chained" )
enum exileKeyList
{
cBoost = 0,
cSeek,
cCad,
cShareOut,
cShareIn,
cCoinsTo,
cCoinsFrom,
cChainedBy,
cChained,
cEnd
};
And access the keys like:
exileKeys[cBoost]
or for example
for(exileKeyList key = cBoost; key < cEnd; key++)
row.push_back(exileKeys[key]);
For a nice efficiency improvement, and consolidation of our key
constants in the header.
Sound good? Or is there a better way?
-Ben
--
NOTE: Please change my address in your address book from bh...@sa...
to bh...@al... as my UCSD address will be permanent.
<http://freepages.sf.rootsweb.com/~bhines/> - My Genealogy Pages
|