```
template<class BidirectionalIterator>
constexpr bool next_permutation(BidirectionalIterator first,
BidirectionalIterator last);
template<class BidirectionalIterator, class Compare>
constexpr bool next_permutation(BidirectionalIterator first,
BidirectionalIterator last, Compare comp);
```

Requires:
BidirectionalIterator shall satisfy the
Cpp17ValueSwappable requirements ([swappable.requirements]).

```
template<class BidirectionalIterator>
constexpr bool prev_permutation(BidirectionalIterator first,
BidirectionalIterator last);
template<class BidirectionalIterator, class Compare>
constexpr bool prev_permutation(BidirectionalIterator first,
BidirectionalIterator last, Compare comp);
```

Requires:
BidirectionalIterator shall satisfy the
Cpp17ValueSwappable requirements ([swappable.requirements]).