| 55 | |
| 56 | template <typename S, typename T> |
| 57 | inline T clampTo(S value, T a, T b) |
| 58 | { |
| 59 | if (value >= static_cast<S>(b)) return b; |
| 60 | if (value <= static_cast<S>(a)) return a; |
| 61 | return static_cast<T>(value); |
| 62 | } |
| 63 | |
| 64 | // easier to redeclare than to force consuming projects to deal with NOMINMAX on Windows |
| 65 | template <typename T> |
no outgoing calls
no test coverage detected