Вы находитесь на странице: 1из 7

Name for_each find find_if

Purpose

Arguments Non- mutating Sequence Operations Applies function to each first, last, function object Returns iterator to first first, last, value object equal to value. Returns iterator to first first, last, predicate object for which predicate is true. - Returns iterator to first adjacent pair of - first, last objects that are equal. - first, last, predicate - Returns iterator to first adjacent pair of objects that satisfy predicate. Adds to n the number of objects equal to first, last, value, n value. Adds to n the number of objects satisfying first, last, predicate, n predicate. - returns first non equal pair of - first1, last1, first2 corresponding objects in two ranges - first1, last1, first2, - returns first pair of corresponding predicate objects in two ranges that dont satisfy predicate - Returns true if corresponding objects in - First1, last1, first2 two ranges are all equal - First1, last1, first2, - Returns true if corresponding objects in predicate two ranges all satisfy predicate - Checks if second range is contained - first1, last1, first2, last2 within the first. Returns start of match, - first1, last1, first2, last2, or last1 if no match. predicate - Checks if second range is contained within the first, where equality is determined by predicate. Returns startof match, or last1 if no match. Mutating sequence operations Copies objects from range Copies objects from range 1 to range 2. 1 to range 2. Copies objects from range1 to range 2, inserting first1, last1, first2 them backwards, from last2 to first2. Interchanges two objects a, b Interchanges objects pointed to by two iter1, iter2 iterators. Interchanges corresponding elements in two first1, last1, first2 ranges. - Transforms objects in range 1 into new - first1, last1, first2, objects in range 2 by applying operator operator. - first1, last1, first2, first3, - Combines objects in range 1 and range operator

adjacent_find

count count_if mismatch

equal

search

copy copy_backward swap iter_swap swap_ranges Transform

replace replace_if replace_copy

replace_copy_if

fill fill_n generate generate_n remove remove_if remove_copy remove_copy_if unique

unique_copy

reverse reverse_copy rotate rotate_copy random_shuffle

2 into new objects in range 3 by applying operator. Replaces all objects equal to old with objects equal to new. Replaces all objects that satisfy predicate with objects equal to new Copies from range 1 to range 2, replacing all objects equal to old with objects equal to new. Copies from range 1 to range 2, replacing all objects that satisfy predicate with objects equal to new. Assigns value to all objects in range. Assigns value to all objects from first to first+n Fills range with values generated by successive calls to function gen. Fills from first to first+n with values generated by successive calls to function gen. Removes from range any objects equal to value. Removes from range any objects that satisfy predicate. Copies objects, excepting those equal to value, from range 1 to range 2. Copies objects, excepting those satisfying pred, from range 1 to range 2. - Eliminates all but the first object from any consecutive sequence of equal objects. - Eliminates all but the first object from any consecutive sequence of objects satisfying predicate. - Copies objects from range1 to range 2, except only the first object from any consecutive sequence of equal objects is copied. - Copies objects from range 1 to range2, except only the first object from any consecutive sequence of objects satisfying predicate is copied. Reverses the sequence of objects in range. Copies range 1 to range 2, reversing the sequence of objects Rotates sequence of objects around iterator middle. Copies objects from range1 to range 2, rotating the sequence around iterator middle. - Randomly shuffles objects in range.

first, last, old, new first, last, predicate, new first1, last1, first2, old, new first1, last1, first2, predicate, new first, last, value first, n, value first, last, gen first, n, gen first, last, value first, last, predicate first1, last1, first2, value first1, last1, first2, pred first, last first, last, predicate

first1, last1, first2 first1, last1, first2, predicate

first, last first1, last1, first2 first, last, middle first1, middle1, last1, first2 first, last

partition stable_partition

sort

stable_sort

partial_sort

partial_sort_copy

nth_element

lower_bound

upper_bound

Randomly shuffles objects in range, first, last, rand using random-number function rand. Moves all objects that satisfy predicate so they first, last, predicate precede those that do not satisfy it. Moves all objects that satisfy predicate so they first, last, predicate precede those that do not, and also preserves relative ordering in the two groups. Sorting and Related operations - Sorts objects in range. - first, last - Sorts elements in range, using comp as - first, last, comp comparison function - Sorts objects in range, maintains order - first, last of equal elements - first, last, comp - Sorts elements in range, using comp as comparison function. Maintains order of equal elements. - Sorts all objects in range, places as - first, middle, last many sorted values as will fit between - first, middle, last, first and middle. Order of objects predicate between middle and last is undefined. - Sorts all objects in range, places as many sorted values as will fit between first and middle. Order of objects between middle and last is undefined. Uses predicate to define ordering. - Same as partial_sort(first, middle, last), - first1, last1, first2, last2 but places resulting sequence in range2. - first1, last1, first2, last2, - Same as partial_sort(first, middle, last, comp predicate), but places resulting sequence in range 2. - Places the nth object in the position it - first, nth, last would occupy if the whole range were - first, nth, last, comp sorted. - Places the nth object in the position it would occupy if the whole range were sorted using comp for comparisons. - Returns iterator to first position into - first, last, value which value could be inserted without - first, last, value, comp violating the ordering. - Returns iterator to first position into which value could be inserted without violating an ordering based on comp. - Returns iterator to last position into - first, last, value which value could be inserted without - first, last, value, comp violating the ordering. - Returns iterator to last position into which value could be inserted without violating an ordering based on comp.

equal_range

binary_search

merge

inplace_merge

includes

set_union

set_intersection

Returns a pair containing the lower bound and upper bound between which value could be inserted without violating the ordering Returns a pair containing the lower bound and upper bound between which value could be inserted without violating an ordering based on comp. Returns true if value is in the range. Returns true if value is in the range, where the ordering is determined by comp. Merges sorted ranges 1 and 2 into sorted range 3. Merges sorted ranges 1 and 2 into sorted range 3, where the ordering is determined by comp. Merges two consecutive sorted ranges, first, middle and middle, last into first, last. Merges two consecutive sorted ranges, first, middle and middle, last into firstlast, where the ordering is based on comp. Returns true if every object in the range first2, last2 is also in the range first1, last. (Sets and multisets only.) Returns true if every object in the range first2- last2 is also in the range first1last1, where ordering is based on comp. (Sets and multisets only.) Constructs sorted union of elements of ranges 1 and 2. (Sets and multisets only.) Constructs sorted union of elements of ranges 1 and 2, where the ordering is based on comp. (Sets and multisets only.) Constructs sorted intersection of elements of ranges 1 and 2. (Sets and multisets only.) Constructs sorted intersection of elements of ranges 1 and 2, where the ordering is based on comp. (Sets and multisets only.)

first, last, value first, last, value, comp

first, last, value first, last, value, comp

first1, last1, first2, last2, first3 first1, last1, first2, last2, first3, comp first, middle, last first, middle, last, comp

first1, last1, first2, last2 first1, last1, first2, last2, comp

first1, last1, first2, last2, first3 first1, last1, first2, last2, first3, comp

first1, last1, first2, last2, first3 first1, last1, first2, last2, first3, comp

set_difference

Constructs sorted difference of

first1, last1, first2, last2,

set_symmetric_ difference

push_heap

pop_heap

make_heap

sort_heap

min

max

max_element

elements of ranges 1 and 2. (Sets and multisets only.) Constructs sorted difference of elements of ranges 1 and 2, where the ordering is based on comp. (Sets and multisets only.) Constructs sorted symmetric difference of elements of ranges 1 and 2. (Sets and multisets only.) Constructs sorted difference of elements of ranges 1 and where the ordering is based on comp. (Sets and multisets only.) Places value from last-1 into resulting heap in range first, last. Places value from last-1 into resulting heap in range first, last, based on ordering determined by comp. Swaps the values in first and last-1; makes range first, last-1 into a heap. Swaps the values in first and last-1; makes range first, last-1 into a heap, based on ordering determined by comp. Constructs a heap out of the range first, last. Constructs a heap out of the range first, last, based on the ordering determined by comp. Sorts the elements in the heap first, last. Sorts the elements in the heap first, last, based on the ordering determined by comp. Returns the smaller of two objects. Returns the smaller of two objects, where the ordering is determined by comp. Returns the larger of two objects. Returns the larger of two objects, where the ordering is determined by comp. Returns an iterator to the largest object in the range. Returns an iterator to the largest object in the range, with an ordering determined by comp.

first3 first1, last1, first2, last2, first3, comp

first1, last1, first2, last2, first3 first1, last1, first2, last2, first3, comp2,

first, last first, last, comp

first, last first, last, comp

first, last first, last, comp

first, last first, last, comp

a, b a, b, comp

a, b a, b, comp

first, last first, last, comp

min_element

lexicographical_ compare

next_permutation

prev_permutation

Accumulate

inner_product

partial_sum

adjacent_ difference

Returns an iterator to the smallest - first, last object in the range. - first, last, comp Returns an iterator to the smallest object in the range, with an ordering determined by comp. Returns true of the sequence in range 1 - first1, last1, first2, last2 comes before the sequence in range 2 - first1, last1, first2, last2, alphabetically. comp Returns true of the sequence in range 1 comes before the sequence in range 2 alphabetically, based on ordering determined by comp. Performs one permutation on the - first, last sequence in the range. - first, last, comp Performs one permutation on the sequence in the range, where the ordering is determined by comp. Performs one reverse permutation on - first, last the sequence in the range. - first, last, comp Performs one reverse permutation on the sequence in the range, where the ordering is determined by comp. Generalized Numeric Operations Sequentially applies init = init + *iter to - first, last, init each object in the range - first, last, init, op Sequentially applies init = op(init, *iter) to each object in the range. Sequentially applies - first1, last1, first2, init init=init+(*iter1)*(*iter2) to - first1, last1, first2, init, corresponding values from ranges 1 and op1, op2 2. Sequentially applies init=op1 (init, op2 (*iter1,*iter2)) to corresponding values from ranges 1 and 2. Adds values from start of range 1 to - first1, last1, first2 current iterator, and places the sums in - first1, last1, first2, op corresponding iterator in range 2. *iter2 = sum (*first1, *(first1+1), *(first1+2), ..*iter1) Sequentially applies op to objects between first1 and current iterator in range 1, and places results in corresponding iterator in range 2. answer = *first; for(iter=first+1; iter != iter1; iter++) op (answer, *iter); *iter2 = answer; Subtracts adjacent objects in range 1 - first1, last1, first2 and places differences in range 2. *iter2 - first1, last1, first2, op

= * (iter1+1) - *iter1; Sequentially applies op to adjacent objects in range 1 and places results in range2. *iter2 = op(*(iter1+1),*iter1);

Вам также может понравиться