You are probably looking for the constrain() macro (an existing implantation of clamp logic, credit goes to @Edgar Bonet)
value = constrain(value + input, -5, 5);
If you get tired of writing constrain() you can even wrap it in a new type (which might be over-engeneering), producing something like following(code not tested)
template<typename T>
struct BoundValue {
T value;
const T vmin, vmax;
//similar for other operators +,/,-=,...
decltype(*this)& operator+=(T operand) { value = constrain(value + operand, vmin, vmax); return *this; }
operator T() const { return value; }
BoundValue(const T& vmin, const T& vmax) : vmin(vmin), vmax(vmax) {}
BoundValue& operator=(const T& other) { value = constrain(other, vmin, vmax); return *this; }
};
and use like variable of its argument type
BoundValue<int> val(-5, 5);
val += 6;//val = 5