摘要: countReturns the number of elements in a range whose values match a specified value.template<class InputIterator, class Type> typename iterator_traits<InputIterator>::difference_type count( InputIterator _First, InputIterator _Last, const Type& _Val );count_ifReturns the number ... 阅读全文
posted @ 2013-03-07 16:23 freewater 阅读(225) 评论(0) 推荐(0) 编辑
摘要: adjacent_findSearches for two adjacent elements that are either equal or satisfy a specified condition.即,找出第一组满足条件的相邻元素。template<class ForwardIterator> ForwardIterator adjacent_find( ForwardIterator _First, ForwardIterator _Last );template<class ForwardIterator , class BinaryPredicate... 阅读全文
posted @ 2013-03-07 16:19 freewater 阅读(177) 评论(0) 推荐(0) 编辑
摘要: make_heapConverts elements from a specified range into a heap in which the first element is the largest and for which a sorting criterion may be specified with a binary predicate.template<class RandomAccessIterator> void make_heap( RandomAccessIterator _First, RandomAccessIterator _Last... 阅读全文
posted @ 2013-03-07 15:34 freewater 阅读(428) 评论(0) 推荐(0) 编辑
摘要: 本节的四个算法所接受的set,必须是有序区间(sorted range),元素值可以重复出现。也就是说,他们可以接受STL的set/multiset容器作为输入区间。set_unionUnites all of the elements that belong to at least one of two sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate.template<clas 阅读全文
posted @ 2013-03-07 15:26 freewater 阅读(618) 评论(0) 推荐(0) 编辑
摘要: 二分查找binary_searchTests whether there is an element in a sorted range that is equal to a specified value or that is equivalent to it in a sense specified by a binary predicate.template<class ForwardIterator, class Type> bool binary_search( ForwardIterator _First, ForwardIterator _Last, ... 阅读全文
posted @ 2013-03-07 15:15 freewater 阅读(501) 评论(0) 推荐(0) 编辑
摘要: copyAssigns the values of elements from a source range to a destination range, iterating through the source sequence of elements and assigning them new positions in a forward direction.template<class InputIterator, class OutputIterator> OutputIterator copy( InputIterator _First, InputIt... 阅读全文
posted @ 2013-03-07 14:48 freewater 阅读(614) 评论(0) 推荐(0) 编辑
摘要: mismatchCompares two ranges element by element either for equality or equivalent in a sense specified by a binary predicate and locates the first position where a difference occurs.template<class InputIterator1, class InputIterator2> pair<InputIterator1, InputIterator2> mismatch( InputIt 阅读全文
posted @ 2013-03-07 13:15 freewater 阅读(267) 评论(0) 推荐(0) 编辑
摘要: maxCompares two objects and returns the larger of the two, where the ordering criterion may be specified by a binary predicate.template<class Type> const Type& max( const Type& _Left, const Type& _Right );template<class Type, class Pr> const Type& max( const Type& _Le 阅读全文
posted @ 2013-03-07 12:34 freewater 阅读(3377) 评论(0) 推荐(0) 编辑
摘要: lexicographical_compareCompares element by element between two sequences to determine which is lesser of the two.(以字典排列方式进行比较)template<class InputIterator1, class InputIterator2> bool lexicographical_compare( InputIterator1 _First1, InputIterator1 _Last1, InputIterator2 _First2, ... 阅读全文
posted @ 2013-03-07 11:07 freewater 阅读(269) 评论(0) 推荐(0) 编辑
摘要: iter_swapExchanges two values referred to by a pair of specified iterators.template<class ForwardIterator1, class ForwardIterator2> void iter_swap( ForwardIterator1 _Left, ForwardIterator2 _Right );这个好像没有什么特别的,就是交换两个迭代器所指向的内容。swapThe first override exchanges the values of two objects. ... 阅读全文
posted @ 2013-03-07 10:59 freewater 阅读(616) 评论(0) 推荐(0) 编辑
摘要: fillAssigns the same new value to every element in a specified range.template<class ForwardIterator, class Type> void fill( ForwardIterator _First, ForwardIterator _Last, const Type& _Val );fill_nAssigns a new value to a specified number of elements in a range beginning with a p... 阅读全文
posted @ 2013-03-07 10:55 freewater 阅读(659) 评论(0) 推荐(0) 编辑