Share this postDaily bit(e) of C++Daily bit(e) of C++ | std::clampCopy linkFacebookEmailNotesMoreDaily bit(e) of C++ | std::clampDaily bit(e) of C++ #286, The C++17 algorithm for clamping values between thresholds: std::clamp.Šimon TóthOct 14, 20232Share this postDaily bit(e) of C++Daily bit(e) of C++ | std::clampCopy linkFacebookEmailNotesMoreShareThe std::clamp is a simple C++17 algorithm that clamps a given value between the minimum and maximum thresholds.If the value is outside the thresholds, the violated threshold is returned instead.Click to open in Compiler Explorer.Leave a commentThanks for reading Daily bit(e) of C++! Subscribe for free to receive new posts and support my work.Subscribe