From: Ian S. <ian...@st...> - 2002-05-29 17:16:49
|
the following compiles on MSVC6.0sp5 for me. #include <vector> template <class Data> void foo( typename std::vector<Data>::iterator, Data* ) {} void main(void) {} But not the specialised int case you describe. Perhaps you could use template <class Data, class Kludge> void foo( typename std::vector<Kludge>::iterator, Data* ) and assume Kludge==int Hope this helps. Ian. > -----Original Message----- > From: Amitha Perera [mailto:pe...@cs...] > Sent: Tuesday, May 28, 2002 8:35 PM > To: vxl...@li... > Subject: [Vxl-users] Visual studio and templates > > > Hi all > > I thought someone with more VC++ knowledge could help: it seems that > the following does not compile with VC++6sp5. > > #include <vector> > > //std::vector<int>::iterator dummy; > > template <class Data> > void foo( typename std::vector<int>::iterator, Data* ) > { > } > > int main() { return 0; } > > Uncommenting line 3 makes everything okay. Any ideas? > > Also, replacing the iterator with a typedef'ed version seems to work, > but this doesn't generalise to replacing "int" with "Data". > > Thanks, > Amitha. > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Vxl-users mailing list > Vxl...@li... > https://lists.sourceforge.net/lists/listinfo/vxl-users > |