![]() |
MySQL 9.6.0
Source Code Documentation
|
Represents a range of integers for which the lower bound is 0, representing the number of repetitions of a token when parsing a string. More...
#include <repeat.h>
Public Member Functions | |
| Repeat_optional () | |
| Default-construct a Repeat_optional object representing a range of 0..1 repetitions, inclusive. More... | |
| Repeat_optional (std::integral auto max) | |
| Construct an object representing a range of 0 up to the given number of repetitions. More... | |
| constexpr std::size_t | min () const |
| Return the mimimum number of repetitions, inclusive; the return value is always 0. More... | |
Public Member Functions inherited from mysql::strconv::detail::Repeat_base< Repeat_optional > | |
| Repeat_base (std::integral auto max) | |
| Construct a new object with the given maximum. More... | |
| std::size_t | max () const |
| Return the maximum number of repetitions, inclusive. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from mysql::strconv::detail::Repeat_base< Repeat_optional > | |
| static Repeat_optional | optional () |
| Return a Repeat_optional object representing zero or one instances. More... | |
| static Repeat_optional | at_most (std::integral auto max_arg) |
Return a Repeat object representing between 0 and min_arg repetitions. More... | |
| static Repeat_optional | any () |
| Return a Repeat_optional object representing any number of repetitions from 0 and up (bounded only by std::numeric_limits). More... | |
Represents a range of integers for which the lower bound is 0, representing the number of repetitions of a token when parsing a string.
This class is similar to Repeat, but limited to ranges that begin at zero. Examples:
The reason we define a distinct class for this case, rather than use Repeat with a specified lower bound of 0, is that some functions taking a number of repetitions as argument cannot fail when 0 is an allowed number of repetitions. Such functions can therefore return void and/or omit the [[nodiscard]] attribute when the argument is of type Repeat_optional.
|
inline |
Default-construct a Repeat_optional object representing a range of 0..1 repetitions, inclusive.
|
inlineexplicit |
Construct an object representing a range of 0 up to the given number of repetitions.
|
inlineconstexpr |
Return the mimimum number of repetitions, inclusive; the return value is always 0.