OpenVPN 3 Core Library
Loading...
Searching...
No Matches
clamp_typerange.hpp File Reference
#include <limits>
#include <algorithm>
#include <functional>
#include "numeric_util.hpp"
Include dependency graph for clamp_typerange.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openvpn
 
namespace  openvpn::numeric_util
 

Functions

template<typename OutT , typename InT >
OutT openvpn::numeric_util::clamp_to_typerange (InT inVal)
 Clamps the input value to the legal range for the output type.
 
template<typename OutT , typename InT >
OutT openvpn::numeric_util::clamp_to_default (InT inVal, OutT defVal)
 Adjusts the input value to the default if the input value exceeds the range of the output type.
 
template<typename OutT , typename InT , typename FuncT >
OutT openvpn::numeric_util::clamp_notify (InT inVal, FuncT cb)
 Calls FuncT cb if the input value exceeds the range of the output type.