[libc++] Add a utility to check whether a range is valid (#87665)

In the future, this utility could be made to also work with iterators,
including bounded iterators. We could also query the ASAN runtime for
this information when it's around.

GitOrigin-RevId: a06073f91e7bbbb532e68bbf6b903c2f5051f4c2
6 files changed