I like the idea of a median free function a lot:
- It's generally useful beyond just clamping.
- It seems like a natural, missing peer to
minandmax. - It neatly avoids the question of if/how to handle half-open ranges.
- For me, a free function is a more intuitive way to surface this functionality (struggling to articulate why).