摘要:
all_ofReturns true when a condition is present at each element in the given range.template<class InputIterator, class Predicate> bool all_of( InputIterator _First, InputIterator _Last, BinaryPredicate _Comp );any_ofReturns true when a condition is present at least once i...
阅读全文
posted @ 2013-03-11 17:12
freewater
阅读(223)
推荐(0)
摘要:
inplace_mergeCombines the elements from two consecutive sorted ranges into a single sorted range, where the ordering criterion may be specified by a binary predicate.template<class BidirectionalIterator> void inplace_merge( BidirectionalIterator _First, BidirectionalIterator _Middle, ...
阅读全文
posted @ 2013-03-11 16:31
freewater
阅读(297)
推荐(0)
摘要:
sortArranges the elements in a specified range into a nondescending order or according to an ordering criterion specified by a binary predicate.template<class RandomAccessIterator> void sort( RandomAccessIterator first, RandomAccessIterator last );template<class RandomAccessIterator, ...
阅读全文
posted @ 2013-03-11 16:21
freewater
阅读(259)
推荐(0)
摘要:
random_shuffleRearranges a sequence of N elements in a range into one of N! possible arrangements selected at random.template<class RandomAccessIterator> void random_shuffle( RandomAccessIterator _First, RandomAccessIterator _Last ); template<class RandomAccessIterator, class Rand...
阅读全文
posted @ 2013-03-11 16:02
freewater
阅读(607)
推荐(0)
摘要:
next_permutationReorders the elements in a range so that the original ordering is replaced by the lexicographically next greater permutation if it exists, where the sense of next may be specified with a binary predicate.template<class BidirectionalIterator> bool next_permutation( Bidirectio...
阅读全文
posted @ 2013-03-11 15:59
freewater
阅读(215)
推荐(0)
摘要:
uniqueRemoves duplicate elements that are adjacent to each other in a specified range.template<class ForwardIterator> ForwardIterator unique( ForwardIterator _First, ForwardIterator _Last );template<class ForwardIterator, class Predicate> ForwardIterator unique( ForwardIterator...
阅读全文
posted @ 2013-03-11 11:29
freewater
阅读(352)
推荐(0)
摘要:
transformApplies a specified function object to each element in a source range or to a pair of elements from two source ranges and copies the return values of the function object into a destination range.template<class InputIterator, class OutputIterator, class UnaryFunction> OutputIterator tr
阅读全文
posted @ 2013-03-11 11:23
freewater
阅读(341)
推荐(0)
摘要:
rotateExchanges the elements in two adjacent ranges.template<class ForwardIterator> void rotate( ForwardIterator _First, ForwardIterator _Middle, ForwardIterator _Last );rotate_copyExchanges the elements in two adjacent ranges within a source range and copies the result to ...
阅读全文
posted @ 2013-03-11 11:15
freewater
阅读(248)
推荐(0)
摘要:
reverseReverses the order of the elements within a range.template<class BidirectionalIterator> void reverse( BidirectionalIterator _First, BidirectionalIterator _Last );reverse_copyReverses the order of the elements within a source range while copying them into a destination range...
阅读全文
posted @ 2013-03-11 11:13
freewater
阅读(245)
推荐(0)
摘要:
replaceExamines each element in a range and replaces it if it matches a specified value.template<class ForwardIterator, class Type> void replace( ForwardIterator _First, ForwardIterator _Last, const Type& _OldVal, const Type& _NewVal );replace_ifExamines each element ...
阅读全文
posted @ 2013-03-11 11:10
freewater
阅读(501)
推荐(0)
摘要:
removeEliminates a specified value from a given range without disturbing the order of the remaining elements and returning the end of a new range free of the specified value.template<class ForwardIterator, class Type> ForwardIterator remove( ForwardIterator _First, ForwardIterator _L...
阅读全文
posted @ 2013-03-11 11:05
freewater
阅读(559)
推荐(0)
摘要:
partitionClassifies elements in a range into two disjoint sets, with those elements satisfying a unary predicate preceding those that fail to satisfy it.template<class BidirectionalIterator, class Predicate> BidirectionalIterator partition( BidirectionalIterator _First, BidirectionalIte...
阅读全文
posted @ 2013-03-11 10:22
freewater
阅读(427)
推荐(0)
摘要:
mergeCombines all of the elements from two sorted source ranges into a single, sorted destination range, where the ordering criterion may be specified by a binary predicate.template<class InputIterator1, class InputIterator2, class OutputIterator> OutputIterator merge( InputIterator1 _First...
阅读全文
posted @ 2013-03-11 10:19
freewater
阅读(331)
推荐(0)
摘要:
汇总打印集合的方法1. for_eachtemplate<class T>struct display{ void operator()(const T& val){ cout<<val<<' '; }};int main(){ vector<int> vec(10); iota(vec.begin(),vec.end(),1); random_shuffle(vec.begin(),vec.end()); for_each(vec.begin(),vec.end(),display<int>()); cout
阅读全文
posted @ 2013-03-11 09:58
freewater
阅读(227)
推荐(0)
摘要:
for_eachApplies a specified function object to each element in a forward order within a range and returns the function object.template<class InputIterator, class Function> Function for_each( InputIterator _First, InputIterator _Last, Function _Func );
阅读全文
posted @ 2013-03-11 09:48
freewater
阅读(157)
推荐(0)
摘要:
includesTests whether one sorted range contains all the elements contained in a second sorted range, where the ordering or equivalence criterion between elements may be specified by a binary predicate.template<class InputIterator1, class InputIterator2> bool includes( InputIterator1 _First1...
阅读全文
posted @ 2013-03-11 09:43
freewater
阅读(293)
推荐(0)