tetris/Utils/Clamp.h

21 lines
302 B
C
Raw Normal View History

2018-02-05 23:44:42 +00:00
/*
* Clamp.h
*
* Created on: May 7, 2013
* Author: chibi_000
*/
#ifndef CLAMP_H_
#define CLAMP_H_
#include <algorithm>
template <typename A, typename B, typename C>
A clamp (A value, B minimum, C maximum)
{
return std::min( std::max(value, minimum) , maximum);
}
#endif /* CLAMP_H_ */