Topic: type from object


Author: "Philip Gruebele" <philipg@bayarea.net>
Date: 1996/10/24
Raw View
Does the c++ standard allow something like this?  If I have an object
declared as follows:

 map<string,int> Object;

and I want to do something like:

 map<string, int>::iterator     it = Object.find(string("hello"));

Is there any way to obtain the "map" class' iterator type from the "Object"
instance.  It would be nice if I could say

 Object::iterator it = Object.find(....);

This could be statically checked and would allow me not to specify all
these long template instantiations.  Is something aking to this in the
standard or planned for the standard?  This could make code maintenance a
little simpler since I can change the type of "Object" without having to go
and change the rest of the code.


Regards

Philip Gruebele
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]