use this function here: https://github.com/oneapi-src/distributed-ranges/pull/545#discussion_r1366677499