[Support] Merge two implementations of addRangeElementsImpl (NFC) (#158212)
This patch uses "constexpr if" to merge two implementations of
addRangeElementsImpl. While the line count does not change much, the
"if" condition should be a lot more readable than in std::enable_if.