MCPcopy Create free account
hub / github.com/LabSound/LabSound / clampTo

Function clampTo

include/LabSound/extended/Util.h:57–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56template <typename S, typename T>
57inline 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
65template <typename T>

Callers 2

panToTargetValueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected