PR 1360 revived: Add clamp function

https://github.com/D-Programming-Language/phobos/pull/1360

As original author did not respond to reviewer comments for some time, I have made necessary changes and created new PR for it.
There is a space missing here. Now _that's_ picking nits. ;)