|
Autopysta
|
A utility class that provides common testing functions. More...
#include <misc.h>
Static Public Member Functions | |
| static bool | range_inc (double number, double min, double max) |
| Check if a number is within an inclusive range. | |
| template<typename T , typename A > | |
| static bool | length (std::vector< T, A > v, int l) |
| Check if a vector has a specific length. | |
A utility class that provides common testing functions.
This class contains utility functions for common tasks like checking if a number falls within a range and checking the length of a vector. It is designed to be a lightweight helper for various validation tasks.
|
static |
Check if a vector has a specific length.
This method checks whether the size of the given vector matches the specified length. It is a templated function, allowing it to work with vectors containing any data type.
| T | The type of the elements in the vector. |
| A | The allocator type for the vector (typically std::allocator). |
| v | The vector to be checked. |
| l | The required length of the vector. |
|
static |
Check if a number is within an inclusive range.
This method checks whether a given number lies between a minimum and a maximum value (both bounds inclusive).
| number | The number to be checked. |
| min | The minimum allowable value. |
| max | The maximum allowable value. |