Renamed to Minimum, Maximum, etc

This commit is contained in:
Patrick Urbanke
2023-11-02 20:02:22 +01:00
parent 815b9fc45d
commit 70b11650f8
3 changed files with 8 additions and 9 deletions
+4 -4
View File
@@ -19,7 +19,7 @@ struct EqualTo {
};
template <double _threshold>
struct GreaterEqual {
struct Minimum {
template <class T>
static Result<T> validate(T _value) noexcept {
constexpr auto threshold = static_cast<T>(_threshold);
@@ -33,7 +33,7 @@ struct GreaterEqual {
};
template <double _threshold>
struct GreaterThan {
struct ExclusiveMinimum {
template <class T>
static Result<T> validate(T _value) noexcept {
constexpr auto threshold = static_cast<T>(_threshold);
@@ -47,7 +47,7 @@ struct GreaterThan {
};
template <double _threshold>
struct LessEqual {
struct Maximum {
template <class T>
static Result<T> validate(T _value) noexcept {
constexpr auto threshold = static_cast<T>(_threshold);
@@ -61,7 +61,7 @@ struct LessEqual {
};
template <double _threshold>
struct LessThan {
struct ExclusiveMaximum {
template <class T>
static Result<T> validate(T _value) noexcept {
constexpr auto threshold = static_cast<T>(_threshold);
+2 -3
View File
@@ -9,9 +9,8 @@
void test_all_of() {
std::cout << "test_all_of" << std::endl;
using Age =
rfl::Validator<unsigned int,
rfl::AllOf<rfl::GreaterThan<0.>, rfl::LessThan<130.>>>;
using Age = rfl::Validator<unsigned int,
rfl::AllOf<rfl::Minimum<0.>, rfl::Maximum<130.>>>;
struct Person {
rfl::Field<"firstName", std::string> first_name;
+2 -2
View File
@@ -11,8 +11,8 @@ void test_any_of() {
using Age = rfl::Validator<
unsigned int,
rfl::AnyOf<rfl::AllOf<rfl::GreaterThan<0.>, rfl::LessThan<10.>>,
rfl::AllOf<rfl::GreaterThan<40.>, rfl::LessThan<130.>>>>;
rfl::AnyOf<rfl::AllOf<rfl::Minimum<0.>, rfl::Maximum<10.>>,
rfl::AllOf<rfl::Minimum<40.>, rfl::Maximum<130.>>>>;
struct Person {
rfl::Field<"firstName", std::string> first_name;