voidreverse(ExecutionPolicy&&policy, BidirIt first, BidirIt last); (2)(C++17 起) 1)反转[first,last)范围中的元素顺序。 表现如同将std::iter_swap应用到对于[0,std::distance(first, last)/2)中的每个整数i对应的一对迭代器first+i和(last-i)-1上。
ForwardIt reverse_copy(ExecutionPolicy&&policy, BidirIt first, BidirIt last, ForwardIt d_first); (2)(C++17 起) 1)给定NN为std::distance(first, last)。将范围[first,last)(源范围)中的元素复制到从d_first开始的包含NN个元素的新范围(目标范围),使得目标范围中元素以逆序排列。
See also reverse reverses the order of elements in a range (function template) ranges::reverse_copy (C++20) creates a copy of a range that is reversed(niebloid) Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/algorithm/reverse_copy&oldid=170515" Navigation...
void reverse( ExecutionPolicy&& policy, BidirIt first, BidirIt last ); (2) (since C++17) 1) Reverses the order of the elements in the range [first, last) Behaves as if applying std::iter_swap to every pair of iterators first+i, (last-i) - 1 for each non-negative i < (last-...
voidreverse(); (noexcept since C++11) Reverses the order of the elements in the container. No references or iterators become invalidated. Parameters (none) Return value (none) Complexity Linear in the size of the container. Example Run this code ...
typename std::iterator_traits<Iter>::value_type, typename std::iterator_traits<Iter>::difference_type, typename std::iterator_traits<Iter>::pointer, typename std::iterator_traits<Iter>::reference > (C++17 前) template< class Iter > class reverse_iterator; (C++17 起) std...
returns a reverse iterator to the beginning (public member function) rendcrend (C++11) returns a reverse iterator to the end (public member function) Capacity empty checks whether the container is empty (public member function) size returns the number of elements ...
std::forward_list::reverse std::forward_list::sort std::forward_list::splice_after std::forward_list::swap std::forward_list::unique std::get(std::array) std::hash std::list std::list::assign std::list::back std::list::begin ...
std::forward_list::reverse std::forward_list::sort std::forward_list::splice_after std::forward_list::swap std::forward_list::unique std::get(std::array) std::hash std::list std::list::assign std::list::back std::list::begin std::list::cbegin std::list::cend std::list::clear...
OutputIt reverse_copy( BidirIt first, BidirIt last, OutputIt d_first ); (until C++20) template< class BidirIt, class OutputIt > constexpr OutputIt reverse_copy( BidirIt first, BidirIt last, OutputIt d_first ); (since C++20) template< class ExecutionPolicy, class BidirIt, class Forw...