Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Static Public Member Functions | Static Public Attributes
Bounded< Rep, Min, Max > Struct Template Reference

Restrict values of an integer type to a defined range. More...

#include <Bounded.h>

Public Member Functions

 Bounded (Rep v)
 Construct a bounded integer. More...
 
Rep value () const
 Access the inner value. More...
 

Static Public Member Functions

static Rep min ()
 The left-bound value. More...
 
static Rep max ()
 The right-bound value. More...
 

Static Public Attributes

static const Rep MIN = Min
 The left-bound value. More...
 
static const Rep MAX = Max
 The right-bound value. More...
 

Detailed Description

template<typename Rep, Rep Min, Rep Max>
struct ble::Bounded< Rep, Min, Max >

Restrict values of an integer type to a defined range.

The range is a closed interval that includes its left-bound (Min) and right-bound value (Max).

Template Parameters
RepThe C++ integer type used to represent the values.
MinMinimum value allowed.
MaxMaximum value allowed.

Definition at line 37 of file Bounded.h.

Constructor & Destructor Documentation

Bounded ( Rep  v)

Construct a bounded integer.

If v is out of the range [Min : Max], then if it is less than Min, the value of the bounded integer will be Min. If it greater than Max, then the value of the bounded integer will be Max.

Parameters
vThe value to store.

Definition at line 47 of file Bounded.h.

Member Function Documentation

static Rep max ( )
static

The right-bound value.

Returns
The highest value that this type can represent

Definition at line 81 of file Bounded.h.

static Rep min ( )
static

The left-bound value.

Returns
The lowest value that this type can represent

Definition at line 71 of file Bounded.h.

Rep value ( ) const

Access the inner value.

Returns
The current value.

Definition at line 61 of file Bounded.h.

Field Documentation

const T MAX = Max
static

The right-bound value.

Definition at line 94 of file Bounded.h.

const T MIN = Min
static

The left-bound value.

Definition at line 89 of file Bounded.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.