22 static_assert( std::numeric_limits<T>::has_infinity,
"Infinity not defined for this type" ) ;
23 return [] (
const T &
value) {
24 return not std::isinf(
value) ;
36 return [func=std::move(func)] (
const std::vector<T> &
value) {
37 return (
value.end() == std::find_if_not(
value.begin(),
value.end(), func ) ) ;
49 return [limit=std::move(limit)] (
const T &
value) {
50 return value > limit ;
62 return [limit=std::move(limit)] (
const T &
value) {
63 return value >= limit ;
75 return [limit=std::move(limit)] (
const T &
value) {
76 return value < limit ;
88 return [limit=std::move(limit)] (
const T &
value) {
89 return value <= limit ;
101 template <
typename T>
103 return [low=std::move(low),high=std::move(high)] (
const T &
value) {
115 template <
typename T>
117 return [mod] (
const T &
value) {
118 return (
value.size() % mod) != 0 ;
128 template <
typename T>
130 return [s] (
const T &
value) {
131 return (
value.size() == s) ;
139 template <
typename T>
141 return [] (
const T &
value) {
142 return not
value.empty() ;
153 template <
typename T>
155 return [lhs=std::move(lhs),rhs=std::move(rhs)](
const T &
value ) {
167 template <
typename T>
169 return [lhs=std::move(lhs),rhs=std::move(rhs)](
const T &
value ) {
179 template <
typename T>
181 return [cnsts=std::move(cnsts)](
const T &
value ) {
182 return cnsts.find(
value ) != cnsts.end() ;
constexpr ValidatorFunctionT< std::vector< T > > forEach(ValidatorFunctionT< T > func)
Apply a validator on each element of the vector.
constexpr ValidatorFunctionT< T > expectSize(std::size_t s)
Validator function checking for the value to have an exact size.
constexpr ValidatorFunctionT< T > notEmpty()
Validator function checking for the value to be non-empty.
constexpr ValidatorFunctionT< T > less(T limit)
Validator function checking for the value to be less than a limit.
constexpr ValidatorFunctionT< T > greaterEqual(T limit)
Validator function checking for the value to be greater or equal to a limit.
constexpr ValidatorFunctionT< T > lessEqual(T limit)
Validator function checking for the value to be less or equal to a limit.
constexpr unsigned long long value(const Flag_t &flag)
constexpr ValidatorFunctionT< T > sizeModulo(std::size_t mod)
Validator function checking for the value to have a size multiple of the input value Only valid if th...
std::function< bool(const T &)> ValidatorFunctionT
constexpr ValidatorFunctionT< T > combineAnd(ValidatorFunctionT< T > lhs, ValidatorFunctionT< T > rhs)
Create a combination of two validator function with 'and' combination.
constexpr ValidatorFunctionT< T > constraints(std::set< T > cnsts)
Create a validator checking for the value that is constrained to the input list.
constexpr ValidatorFunctionT< T > combineOr(ValidatorFunctionT< T > lhs, ValidatorFunctionT< T > rhs)
Create a combination of two validator function with 'or' combination.
constexpr ValidatorFunctionT< T > greater(T limit)
Validator function checking for the value to be greater than a limit.
constexpr ValidatorFunctionT< T > inRange(T low, T high)
Validator function checking for the value to be within a specific range, boundaries included Only val...
constexpr ValidatorFunctionT< T > notInfinity()
Validator function checking for non-infinite values.