prev_permutation [C++ Reference]
Keywords: stl,algorithm,prev_permutation
Date: 2009-10-09T02:14:39-0700

[[prev_permutation]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## prev_permutation

Syntax:

        #include <algorithm>
        bool prev_permutation( bidirectional_iterator start, bidirectional_iterator end );
        bool prev_permutation( bidirectional_iterator start, bidirectional_iterator end, StrictWeakOrdering cmp );

The prev_permutation() function attempts to transform the given range of elements [start,end) into the next lexicographically smaller permutation of elements. If it succeeds, it returns true, otherwise, it returns false.

If a strict weak ordering function object cmp is provided, it is used instead of the < operator when comparing elements.

Related Topics: next_permutation, random_sample, random_sample_n, random_shuffle

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •