From 720c15762b5d37c6dadf749b45442cf852f72c70 Mon Sep 17 00:00:00 2001 From: Patrick Urbanke Date: Fri, 3 Nov 2023 22:10:18 +0100 Subject: [PATCH] Use auto for the template parameters --- include/rfl/comparisons.hpp | 12 ++++++------ tests/test_all_of.hpp | 2 +- tests/test_any_of.hpp | 4 ++-- tests/test_one_of.hpp | 4 ++-- tests/test_size.hpp | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/rfl/comparisons.hpp b/include/rfl/comparisons.hpp index 39d68c0b..606c3c39 100644 --- a/include/rfl/comparisons.hpp +++ b/include/rfl/comparisons.hpp @@ -5,7 +5,7 @@ namespace rfl { -template +template struct EqualTo { template static Result validate(T _value) noexcept { @@ -19,7 +19,7 @@ struct EqualTo { } }; -template +template struct Minimum { template static Result validate(T _value) noexcept { @@ -33,7 +33,7 @@ struct Minimum { } }; -template +template struct ExclusiveMinimum { template static Result validate(T _value) noexcept { @@ -47,7 +47,7 @@ struct ExclusiveMinimum { } }; -template +template struct Maximum { template static Result validate(T _value) noexcept { @@ -61,7 +61,7 @@ struct Maximum { } }; -template +template struct ExclusiveMaximum { template static Result validate(T _value) noexcept { @@ -75,7 +75,7 @@ struct ExclusiveMaximum { } }; -template +template struct NotEqualTo { template static Result validate(T _value) noexcept { diff --git a/tests/test_all_of.hpp b/tests/test_all_of.hpp index 26baafe1..a29dded7 100644 --- a/tests/test_all_of.hpp +++ b/tests/test_all_of.hpp @@ -10,7 +10,7 @@ void test_all_of() { std::cout << "test_all_of" << std::endl; using Age = rfl::Validator, rfl::Maximum<130.>>>; + rfl::AllOf, rfl::Maximum<130>>>; struct Person { rfl::Field<"firstName", std::string> first_name; diff --git a/tests/test_any_of.hpp b/tests/test_any_of.hpp index 1837aaab..96cb7345 100644 --- a/tests/test_any_of.hpp +++ b/tests/test_any_of.hpp @@ -11,8 +11,8 @@ void test_any_of() { using Age = rfl::Validator< unsigned int, - rfl::AnyOf, rfl::Maximum<10.>>, - rfl::AllOf, rfl::Maximum<130.>>>>; + rfl::AnyOf, rfl::Maximum<10>>, + rfl::AllOf, rfl::Maximum<130>>>>; struct Person { rfl::Field<"firstName", std::string> first_name; diff --git a/tests/test_one_of.hpp b/tests/test_one_of.hpp index c57564a3..a5d7fa9c 100644 --- a/tests/test_one_of.hpp +++ b/tests/test_one_of.hpp @@ -11,8 +11,8 @@ void test_one_of() { using Age = rfl::Validator< unsigned int, - rfl::OneOf, rfl::Maximum<10.>>, - rfl::AllOf, rfl::Maximum<130.>>>>; + rfl::OneOf, rfl::Maximum<10>>, + rfl::AllOf, rfl::Maximum<130>>>>; struct Person { rfl::Field<"firstName", std::string> first_name; diff --git a/tests/test_size.hpp b/tests/test_size.hpp index c9cd2ca6..74ef81de 100644 --- a/tests/test_size.hpp +++ b/tests/test_size.hpp @@ -15,10 +15,10 @@ void test_size() { rfl::Field<"firstName", std::string> first_name; rfl::Field<"lastName", std::string> last_name; rfl::Field<"birthday", rfl::Timestamp<"%Y-%m-%d">> birthday; - rfl::Field<"children", - rfl::Validator< - std::vector, - rfl::Size, rfl::EqualTo<3.>>>>> + rfl::Field< + "children", + rfl::Validator, + rfl::Size, rfl::EqualTo<3>>>>> children; };