Topic: var::type


Author: Gregory Bond <gnb@itga.com.au>
Date: 1998/05/21
Raw View
The idiom "var::type" seems such a useful idea (especially for STL
iterators) that I am sure it was considered and rejected in the recent
standards process.  Why was it rejected?

I.e. what is the problem with allowing
 map<Fixed<7>, vector<RcPtr<Foo> >, less<Fixed<7> > > mfv;
 // pages of code....
 mfv::iterator i(mfv.begin());

I know I can use typedefs to reduce the typing and chance of mistakes
(and I do), but using the variable name seems much more intuitive.  I
know that I unconciously use this idiom when I am creating code and
fixing it up is usually the first oops-it-wont-compile bug fix!
--
Gregory Bond                            ITG Australia Ltd, Melbourne, Australia
<mailto:gnb@itga.com.au>                           <http://www.bby.com.au/~gnb>
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]