OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::Util::clamped_value< Value, LowerLimit, UpperLimit, > Class Template Reference

Wrapper for clamping variable values. More...

#include <common/Util.h>

Public Member Functions

 clamped_value (Value &&value)
 clamped_value (int &&value)
 clamped_value (unsigned int &&value)
constexpr operator Value & ()
constexpr operator Value () const

Detailed Description

template<typename Value, Value LowerLimit, Value UpperLimit, if_is_integer_t< Value > = true>
class OSCR::Util::clamped_value< Value, LowerLimit, UpperLimit, >

Wrapper for clamping variable values.

A wrapper for clamping class values and preventing attempts to set a value outside of a specified range.

Note
This wrapper is not a replacement for sanity checks as it will not attempt to manipulate the values beyond keeping them within the specified bounds. It is only intended to help with keeping the program from accessing invalid memory.

The documentation for this class was generated from the following file:
  • C:/Developer/Projects/OSCR/oscr-firmware/include/common/Util.h