1) What is the convention used in practice when typedef’ing
something like
typedef std::map<SomeClass*, SomeOtherClass> [SomeStandardName>]
typedef std::map<SomeClass*, std<SomeOtherClass> > <[SomeStandardName]
2) Where do you usually put typedef: header files globally, local to the class?
3) Do you typedef iterators or const map<> version?
4) Say you have map that used by two different concepts, do you create two separate typedefs them?
typedef map<string, SomeClass *> IDToSomeClassMap;
typedef map<string, SomeClass *> DescriptionToSomeClassMap;
Thanks
Edit #1
I am interested specifically in typedef STL maps, such as
typedef map<int, string> IdToDescriptionMap
or
typedef map<int, string> IdToDescription
What are common practices?
I prefer the following convention:
I purposely avoid typedef’ing the iterators, I prefer explicitly referring to them as:
Since the iterators are already a de facto standard typename. And FooToBarMapConstIter is actually less clear to read when skimming code, I find.