libycxx

function object

std::ranges::clamp

Scope
std::ranges

Synopsis

inline constexpr /* implementation-defined */ clamp = {};

Call signatures

clamp is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.

  1. template<
        class T,
        class Proj = std::identity,
        std::indirect_strict_weak_order<std::projected<const T*, Proj>> Comp = std::ranges::less>
    [[nodiscard]] constexpr const T& clamp(
        const T& v,
        const T& lo,
        const T& hi,
        Comp comp = {},
        Proj proj = {});
    (1)