* @brief Finds the range of elements that are equal to a specified value in a sorted range. * * This function returns a `Pair` representing the range of elements in the sorted array `base` * that are equal to the value `val`, as determined by the comparison function `comp`. The * `first` element in the `Pair` is the first element in the range, and the `second` element * is one past the last e
| 1381 | * `first` points to the first element in the range, and `second` points to one past the last element. |
| 1382 | */ |
| 1383 | Pair algorithm_equal_range(const void *base, size_t num, size_t size, const void *val, CompareFunc comp) { |
| 1384 | ALGORITHM_LOG("[algorithm_equal_range] Info: Finding equal range for value in array with %zu elements.", num); |
| 1385 | |
| 1386 | |
| 1387 | Pair range; |
| 1388 | range.first = algorithm_lower_bound(base, num, size, val, comp); |
| 1389 | range.second = algorithm_upper_bound(base, num, size, val, comp); |
| 1390 | |
| 1391 | ALGORITHM_LOG("[algorithm_equal_range] Success: Equal range found."); |
| 1392 | return range; |
| 1393 | } |
| 1394 | |
| 1395 | |
| 1396 | /** |
nothing calls this directly
no test coverage detected