Earlier, someone posted a question about std::clamp but the thread was removed before I had a chance to respond (probably because the OP realized his mistake).
The result was stored as a reference. It was OK in this case because all the arguments were variables but I just wanted to point out that one should be careful when storing the result of std::clamp as a reference (same with std::max/std::min) because if you instead pass literals (temporaries) then they would get destroyed at the end of the statement and you would end up with a dangling reference.
1 2 3
int number = 21;
constint &p = std::clamp(number, 10, 20);
std::cout << p << "\n"; // Undefined behaviour! (p refers to the temporary object created by the literal 20 which no longer exists)
There were no real need to store the result as a reference, and I can't remember when I have ever needed it, so I would say it's probably best to avoid it. A situation where you might want to do it is if you're using it with a class type that cannot be copied or that is costly to copy.
The 'rule of thumb' is to use const ref where the size of the data to be passed is greater than the size of a pointer - as behind the scene refs are passed as pointers. So for 64-bit, anything with a size less 9 bytes pass by value otherwise pass by const ref.