On Wed, 18 Oct 2000, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> | Below are the remaining warning messages in support.
> | Note that count returns distance_type. Shall I cast this off to
> | unsigned int?
> iterator_traits<>::difference_type you mean.
No, distance_type. See bottom for the synopsis from "man count"
> return an unsigned int or size_t.
> size-t is probably best.
No cast at all. Makes sense (makes me sound like an expert. Which I'm not!).
Modified patch attached.
Angus
from "man count":
#include <algorithm>
template<class InputIterator, class T>
iterator_trait<InputIterator>::distance_type
count(InputIterator first, InputIterator last,
const T& value);
template <class InputIterator, class T, class Size>
void count(InputIterator first, InputIterator last,
const T& value, Size& n);
template<class InputIterator, class Predicate>
iterator_trait<InputIterator>::distance_type
count_if(InputIterator first, InputIterator last,
Predicate pred);
template <class InputIterator, class Predicate, class Size>
void count_if(InputIterator first, InputIterator last,
Predicate pred, Size& n);
patch_support.bz2