Алгоритм count() - часть 2
* от RogueWave поддерживается более ранняя версия, в которой
* типа distance_type еще не было, так что count()
* возвращала результат в последнем аргументе
*
* вот как должен выглядеть вызов:
*
* typedef iterator_traits<InputIterator>::
* distance_type dis_type;
*
* dis_type elem_count;
* elem_count = count( textlines.begin(), textlines.end(),
* search_item );
***********************************************************************
int elem_count = 0;
list<string,allocator>::iterator
ibegin = textlines.begin(),
iend = textlines.end();
// устаревшая форма count()
count( ibegin, iend, search_item, elem_count );
cout << "count(): " << search_item
<< " встречается " << elem_count << " раз(а)\n";
}