| 4674 | */ |
| 4675 | template <typename container_type_, typename string_extractor_> |
| 4676 | status_t try_argsort(container_type_ const &container, string_extractor_ const &extractor, |
| 4677 | sorted_idx_t *order) noexcept { |
| 4678 | |
| 4679 | // Pack the arguments into a single structure to reference it from the callback. |
| 4680 | using args_t = sequence_args_<container_type_, string_extractor_>; |
| 4681 | args_t args {container, extractor}; |
| 4682 | sz_sequence_t sequence; |
| 4683 | sequence.handle = &args; |
| 4684 | sequence.count = container.size(); |
| 4685 | sequence.get_start = call_sequence_member_start_<container_type_, string_extractor_>; |
| 4686 | sequence.get_length = call_sequence_member_length_<container_type_, string_extractor_>; |
| 4687 | |
| 4688 | using sz_alloc_type = sz_memory_allocator_t; |
| 4689 | return _with_alloc<std::allocator<sz_u8_t>>( |
| 4690 | [&](sz_alloc_type &alloc) { return sz_sequence_argsort(&sequence, &alloc, order); }); |
| 4691 | } |
| 4692 | |
| 4693 | /** |
| 4694 | * @brief Locates the positions of the elements in 2 deduplicated string arrays that have identical values. |
no test coverage detected
searching dependent graphs…