Skip to content

Commit 126ffc9

Browse files
Constrain the iterator types of stable_counting_sort with a requires clause
1 parent e19b98a commit 126ffc9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libs/libvtrutil/src/vtr_sort.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace vtr {
4242
* @param num_keys Exclusive upper bound on the keys. Every key must be smaller than this.
4343
*/
4444
template<typename InIt, typename OutIt, typename KeyFn>
45+
requires std::forward_iterator<InIt> && std::random_access_iterator<OutIt>
4546
void stable_counting_sort(InIt first, InIt last, OutIt out, size_t num_keys, KeyFn key_of) {
4647
// The sort runs in three passes:
4748
// 1. Count how many elements have each key.

0 commit comments

Comments
 (0)