typedef hash_map<int, list<string> > EXCEL_ROW;
EXCEL_ROW row;
why is typedef used here?
couldn't i just say...
hash_map<int, list<string> > row;
Does it have any additional advantage to use the typedef method..
Printable View
typedef hash_map<int, list<string> > EXCEL_ROW;
EXCEL_ROW row;
why is typedef used here?
couldn't i just say...
hash_map<int, list<string> > row;
Does it have any additional advantage to use the typedef method..
1) It is more easier to read,Quote:
Originally Posted by armen_shlang
2) If you changed the typedef from hash_map to a std::map, you don't have to change all of your code also.
3) it doesn't wear out your keyboard having to type
"hash_map<int, list<string> >"
all over the place.
Regards,
Paul McKenzie
In addition to what Paul said ...
string is a typedef, so you could also write:Quote:
Originally Posted by armen_shlang
As you can see, typedef makes it easier to read the code.Code:hash_map<int, list<basic_string<char> > > row;