[ADT] Refactor SmallVector::assertSafeToAddRange with "constexpr if" (#160004)
This patch consolidates two implementations of assertSafeToAddRange
into a single template function.
The new implementation uses "constexpr if" to check for pointer
iterators, preserving the original behavior while simplifying the
code.