A simple struct template useful to store ranges of values as min/max pairs.
-
T_ minimum
- Lower bound
-
T_ maximum
- Higher bound
-
range()
- Construct the object by calling default constructors for min and max
-
range(const T_ &mn, const T_ &mx)
- Construct and initialize min and max directly
-
void set(const T_ &mn, const T_ &mx)
- Set min and max
-
T_ get_random() const
- Get a random value between min and max
Documentation
A simple struct template useful to store ranges of values as min/max pairs.
This struct template helps storing min/max ranges for values of any kind; class T_
is
the type of values to be stored, and it must support operations T_ + T_
, T_ - T_
,
and T_ * float
, otherwise the get_random()
method will not compile.
This struct could be extended to customize the random number generator (now it uses only
std::rand()
).
- T_ minimum
- Lower bound
- T_ maximum
- Higher bound
- range()
- Construct the object by calling default constructors for min and max
- range(const T_ &mn, const T_ &mx)
- Construct and initialize min and max directly
- void set(const T_ &mn, const T_ &mx)
- Set min and max
- T_ get_random() const
- Get a random value between min and max
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.