Hey guys, I am rather new to using the C++ STL, and I would like some help with the std::count function. I have a list that contains strings, and I would like to make a function that counts the number a string repeats itself in the list...
Now, I was reading about the std::count function, and all examples are showing it counting the number of integers are in a list. I was wondering if it is possible to use that function to count how many times a string is repeated.
Here is the way I wrote the function:
int cWaitingLine::m_FindRepeats( std::string Name )
{
int NumberOfRepeats = std::count( WaitLineIterator, WaitLine.end(), Name );
return NumberOfRepeats;
}
WaitLineIterator is defined as std::list< std::string >::iterator WaitLineIterator = WaitLine.begin()