1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
hi(swap) hi(swap_ranges)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(void swap(Type &object1, Type &object2) noexcept;)
itt(void swap(Type (&object1)[N], Type (&object2))[N] noexcept;)
itt(ForwardIterator2 swap_ranges([ExecPol,] ForwardIterator1 first1,
ForwardIterator1 last1, ForwardIterator2 result);)
)
it() Description:
itemization(
it() The first prototype: the elements tt(object1) and tt(object2)
exchange their values. They do so by either cyclic copy assignment or cyclic
move assignment (if available).
it() The second prototype: the elements of the (compile-time) known
sizes of the tt(object1) and tt(object2) arrays exchange their values.
it() The third prototype: elements in the range pointed to by
rangett(first1, last1) are swapped with that number of elements in the range
rangett(result, returnvalue), where tt(returnvalue) is the value returned by
the function. The two ranges must be disjoint.
)
it() Example:
verbinclude(-a examples/swap.cc)
)
|