diff --git a/src/database/row.hpp b/src/database/row.hpp index 1b50ff946d22a0fa2d9ff144178e8b40283f26ce..2d55897d8940b2ee59d5e9f9d4e2170520d2bc31 100644 --- a/src/database/row.hpp +++ b/src/database/row.hpp @@ -30,13 +30,13 @@ struct Row } template - void save(std::unique_ptr& db, typename std::enable_if && Coucou>::type* = nullptr) + void save(std::unique_ptr& db, typename std::enable_if::value && Coucou>::type* = nullptr) { this->insert(*db); } template - void save(std::unique_ptr& db, typename std::enable_if && Coucou>::type* = nullptr) + void save(std::unique_ptr& db, typename std::enable_if::value && Coucou>::type* = nullptr) { const Id& id = std::get(this->columns); if (id.value == Id::unset_value) diff --git a/src/utils/is_one_of.hpp b/src/utils/is_one_of.hpp index 4d6770e3a44c7704c301fadfe6ab0f2fc3a030b3..c706421ac78329c6d4cc7baa5bef0c8ca9a758eb 100644 --- a/src/utils/is_one_of.hpp +++ b/src/utils/is_one_of.hpp @@ -3,15 +3,12 @@ #include template -struct is_one_of_implem { +struct is_one_of { static constexpr bool value = false; }; template -struct is_one_of_implem { +struct is_one_of { static constexpr bool value = - std::is_same::value || is_one_of_implem::value; + std::is_same::value || is_one_of::value; }; - -template -constexpr bool is_one_of = is_one_of_implem::value; diff --git a/tests/utils.cpp b/tests/utils.cpp index 6de19f066ba76196cdf0352b34a5c88f50ec4578..99c7040f132eff538c2de5188fe6f6c843539bce 100644 --- a/tests/utils.cpp +++ b/tests/utils.cpp @@ -175,11 +175,11 @@ TEST_CASE("dirname") TEST_CASE("is_in") { - CHECK((is_one_of) == true); - CHECK((is_one_of) == false); - CHECK((is_one_of) == false); - CHECK((is_one_of) == true); - CHECK((is_one_of) == false); - CHECK((is_one_of) == true); - CHECK((is_one_of) == true); + CHECK((is_one_of::value) == true); + CHECK((is_one_of::value) == false); + CHECK((is_one_of::value) == false); + CHECK((is_one_of::value) == true); + CHECK((is_one_of::value) == false); + CHECK((is_one_of::value) == true); + CHECK((is_one_of::value) == true); }