absl::c_prev_permutation

c_prev_permutation overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::prev_permutation() function to rearrange a container's elements into the next lexicographically lesser permutation.

template<typename C>
constexpr
bool
c_prev_permutation(C& c);
» more...

Overload of c_prev_permutation() for performing a lexicographical comparison using a comp operator instead of operator<.

template<
    typename C,
    typename LessThan>
constexpr
bool
c_prev_permutation(
    C& c,
    LessThan&& comp);
» more...

Return Value

true if a previous permutation exists, false if the range was reset to the last permutation.

Parameters

NameDescription
cThe container to rearrange.
compThe comparison used to order the elements.