Boost logo

Boost :

From: Vladislav Lazarenko (snail_at_[hidden])
Date: 2006-01-16 03:18:07

Is there any library to do thing like this more easily?


int x = -10;
int rating = std::max(std::min(x, 5), 0);


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.

Boost list run by bdawes at, gregod at, cpdaniel at, john at