View Single Post
Old 05-25-2005, 02:38 AM   #1 (permalink)
tis99
Registered User
 
Join Date: May 2005
Posts: 1
tis99 is on a distinguished road
vector of own objects

Hello,

Im trying to create a vector of objects of a class that I defined:

std::vector <element*> elementList;

within the element class I have a member function called checkNames which I try to use thus:

std::vector <element*>::iterator listIter;

for (listIter = this->elementList.begin( ); listIter < this->elementList.end( ); listIter++)
if (listIter->checkName (elementName))
..

The problem I am getting is that the compiler gives back the following message for the last line:

error C2839: invalid return type 'std::vector<_Ty>::_Tptr' for overloaded 'operator ->'

Does anybody know what I am doing wrong please?

Mark
tis99 is offline   Reply With Quote