STL与泛型编程<十八>:STL算法之非变动性算法(Nonmodifying algorithm)
1.元素计数(count和count_if)count声明:template
typenameiterator_traits::difference_type//返回值
count(InputIteratorfirst,InputIteratorlast,constT&val)
{
typenameiterator_traits::difference_typeret=0;
while(first