On 9/28/12, Gabriel Dos Reis <g...@integrable-solutions.net> wrote: > On Fri, Sep 28, 2012 at 8:18 AM, Michael Matz <m...@suse.de> wrote: >>> It is common practice to have >>> >>> struct Q >>> { >>> typedef int E; >>> E getme (int index); >>> }; >> >> Easy: I wouldn't make a typedef for Q::E that merely is int. The reason >> is that it makes knowing what getme really returns harder. > > The point of these nested type is precisely to allow a *uniform* access > to associated from within a template (e.g. a container) -- irrespective of > what those types happen to resolve to, builtin or not.
Perhaps an analogy might be helpful. If I say "Tim's father" you know role of that person without knowing exactly who it is. The typedef convention serves the same purpose. It is important that we use the same term for father, or we wouldn't be able to communicate. -- Lawrence Crowl