Argument's number of values managing class.
More...
#include <range.hpp>
|
| range (const std::optional< count_type > lower_bound, const std::optional< count_type > upper_bound) |
| Private constructor: creates a possibly unbound range.
|
|
Argument's number of values managing class.
Definition at line 18 of file range.hpp.
◆ count_type
◆ range() [1/6]
ap::nargs::range::range |
( |
| ) |
|
|
inline |
Default constructor: creates range [1, 1].
Definition at line 23 of file range.hpp.
◆ range() [2/6]
Exact count constructor: creates range [n, n].
- Parameters
-
Definition at line 29 of file range.hpp.
◆ range() [3/6]
Concrete range constructor: creates range [lower_bound, upper_bound].
- Parameters
-
lower_bound | The lower bound. |
upper_bound | The upper bound. |
Definition at line 36 of file range.hpp.
◆ range() [4/6]
ap::nargs::range::range |
( |
const range & |
| ) |
|
|
default |
◆ range() [5/6]
ap::nargs::range::range |
( |
range && |
| ) |
|
|
default |
◆ ~range()
ap::nargs::range::~range |
( |
| ) |
|
|
default |
◆ range() [6/6]
ap::nargs::range::range |
( |
const std::optional< count_type > |
lower_bound, |
|
|
const std::optional< count_type > |
upper_bound |
|
) |
| |
|
inlineprivate |
Private constructor: creates a possibly unbound range.
- Parameters
-
lower_bound | The optional lower bound of the range. |
upper_bound | The optional upper bound of the range. |
Definition at line 121 of file range.hpp.
◆ is_bound()
bool ap::nargs::range::is_bound |
( |
| ) |
const |
|
inlinenoexcept |
Returns true
if at least one bound (lower, upper) is set. Otherwise returns false
Definition at line 48 of file range.hpp.
◆ operator=() [1/2]
range & ap::nargs::range::operator= |
( |
const range & |
| ) |
|
|
default |
◆ operator=() [2/2]
◆ ordering()
Determines the ordering of the count against a range instance.
For a [lower, upper]
range and the count n
the returned value is:
less
if n < lower
,
equivalent
if n >= lower
and n <= upper
,
greater
if n > upper
. If either lower
or upper
limits are not set (std::nullopt), then the corresponding conditions are dropped.
- Parameters
-
n | The value count to order. |
- Returns
- Ordering relationship between the count and the range.
Definition at line 65 of file range.hpp.
◆ any
range
class builder function. Creates a range [0, inf].
- Returns
- Built
range
class instance.
Definition at line 170 of file range.hpp.
◆ at_least
range
class builder function. Creates a range [n, inf].
- Parameters
-
- Returns
- Built
range
class instance.
Definition at line 135 of file range.hpp.
◆ less_than
range
class builder function. Creates a range [0, n - 1].
- Parameters
-
- Returns
- Built
range
class instance.
Definition at line 153 of file range.hpp.
◆ more_than
range
class builder function. Creates a range [n + 1, inf].
- Parameters
-
- Returns
- Built
range
class instance.
Definition at line 144 of file range.hpp.
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
os, |
|
|
const range & |
r |
|
) |
| |
|
friend |
◆ up_to
range
class builder function. Creates a range [0, n].
- Parameters
-
- Returns
- Built
range
class instance.
Definition at line 162 of file range.hpp.
◆ _default_bound
constexpr count_type ap::nargs::range::_default_bound = 1ull |
|
staticconstexprprivate |
◆ _lower_bound
std::optional<count_type> ap::nargs::range::_lower_bound |
|
private |
◆ _upper_bound
std::optional<count_type> ap::nargs::range::_upper_bound |
|
private |
The documentation for this class was generated from the following file: