
16 Jan
2006
16 Jan
'06
8:18 a.m.
Is there any library to do thing like this more easily? [code] int x = -10; int rating = std::max(std::min(x, 5), 0); [/code] As a result, we will have rating in range 0-5. I looked at the minmax library, but looks like there is not such function :-? Maybe I am looking in a wrong way? Thanks in advance, Vladislav Lazarenko.