From 9116a7bcc4259324f18defc12e0b0bfdd4925c4d Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sat, 5 Feb 2022 08:52:42 +0700 Subject: [PATCH] fix more warnings --- CMakeLists.txt | 2 -- headers/meta.hpp/meta_base/enum_bitflags.hpp | 12 ++++++------ .../meta_detail/value_traits/equals_traits.hpp | 4 ++-- .../meta_detail/value_traits/less_traits.hpp | 4 ++-- headers/meta.hpp/meta_indices/evalue_index.hpp | 4 ++-- headers/meta.hpp/meta_indices/function_index.hpp | 4 ++-- headers/meta.hpp/meta_indices/member_index.hpp | 4 ++-- headers/meta.hpp/meta_indices/method_index.hpp | 4 ++-- headers/meta.hpp/meta_indices/scope_index.hpp | 4 ++-- headers/meta.hpp/meta_indices/variable_index.hpp | 4 ++-- 10 files changed, 22 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81720da..ab5d80a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,7 @@ target_compile_options(${PROJECT_NAME} -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-covered-switch-default - -Wno-ctad-maybe-unsupported -Wno-exit-time-destructors - -Wno-float-equal -Wno-global-constructors -Wno-padded -Wno-shadow-field-in-constructor diff --git a/headers/meta.hpp/meta_base/enum_bitflags.hpp b/headers/meta.hpp/meta_base/enum_bitflags.hpp index 5b021cb..a98db15 100644 --- a/headers/meta.hpp/meta_base/enum_bitflags.hpp +++ b/headers/meta.hpp/meta_base/enum_bitflags.hpp @@ -133,7 +133,7 @@ namespace enum_hpp::bitflags }\ template < typename Enum >\ constexpr bitflags operator op (bitflags l, Enum r) noexcept {\ - return l op bitflags{r};\ + return l op bitflags{r};\ }\ template < typename Enum >\ constexpr bitflags operator op (bitflags l, bitflags r) noexcept {\ @@ -141,7 +141,7 @@ namespace enum_hpp::bitflags }\ template < typename Enum >\ constexpr bitflags& operator op##= (bitflags& l, Enum r) noexcept {\ - return l = l op bitflags{r};\ + return l = l op bitflags{r};\ }\ template < typename Enum >\ constexpr bitflags& operator op##= (bitflags& l, bitflags r) noexcept {\ @@ -319,14 +319,14 @@ namespace enum_hpp::bitflags #define ENUM_HPP_OPERATORS_DECL(Enum)\ constexpr ::enum_hpp::bitflags::bitflags operator~ [[maybe_unused]] (Enum l) noexcept {\ - return ~::enum_hpp::bitflags::bitflags(l);\ + return ~::enum_hpp::bitflags::bitflags(l);\ }\ constexpr ::enum_hpp::bitflags::bitflags operator| [[maybe_unused]] (Enum l, Enum r) noexcept {\ - return ::enum_hpp::bitflags::bitflags(l) | ::enum_hpp::bitflags::bitflags(r);\ + return ::enum_hpp::bitflags::bitflags(l) | ::enum_hpp::bitflags::bitflags(r);\ }\ constexpr ::enum_hpp::bitflags::bitflags operator& [[maybe_unused]] (Enum l, Enum r) noexcept {\ - return ::enum_hpp::bitflags::bitflags(l) & ::enum_hpp::bitflags::bitflags(r);\ + return ::enum_hpp::bitflags::bitflags(l) & ::enum_hpp::bitflags::bitflags(r);\ }\ constexpr ::enum_hpp::bitflags::bitflags operator^ [[maybe_unused]] (Enum l, Enum r) noexcept {\ - return ::enum_hpp::bitflags::bitflags(l) ^ ::enum_hpp::bitflags::bitflags(r);\ + return ::enum_hpp::bitflags::bitflags(l) ^ ::enum_hpp::bitflags::bitflags(r);\ } diff --git a/headers/meta.hpp/meta_detail/value_traits/equals_traits.hpp b/headers/meta.hpp/meta_detail/value_traits/equals_traits.hpp index bd87246..19bf177 100644 --- a/headers/meta.hpp/meta_detail/value_traits/equals_traits.hpp +++ b/headers/meta.hpp/meta_detail/value_traits/equals_traits.hpp @@ -24,11 +24,11 @@ namespace meta_hpp::detail { template < typename T > requires requires(const T& l, const T& r) { - { l == r } -> stdex::convertible_to; + { std::equal_to<>{}(l, r) } -> stdex::convertible_to; } struct equals_traits { bool operator()(const T& l, const T& r) const { - return l == r; + return std::equal_to<>{}(l, r); } }; } diff --git a/headers/meta.hpp/meta_detail/value_traits/less_traits.hpp b/headers/meta.hpp/meta_detail/value_traits/less_traits.hpp index ac39ce4..4140163 100644 --- a/headers/meta.hpp/meta_detail/value_traits/less_traits.hpp +++ b/headers/meta.hpp/meta_detail/value_traits/less_traits.hpp @@ -24,11 +24,11 @@ namespace meta_hpp::detail { template < typename T > requires requires(const T& l, const T& r) { - { l < r } -> stdex::convertible_to; + { std::less<>{}(l, r) } -> stdex::convertible_to; } struct less_traits { bool operator()(const T& l, const T& r) const { - return l < r; + return std::less<>{}(l, r); } }; } diff --git a/headers/meta.hpp/meta_indices/evalue_index.hpp b/headers/meta.hpp/meta_indices/evalue_index.hpp index 8381bc8..8d28db8 100644 --- a/headers/meta.hpp/meta_indices/evalue_index.hpp +++ b/headers/meta.hpp/meta_indices/evalue_index.hpp @@ -32,10 +32,10 @@ namespace meta_hpp } inline bool operator<(const evalue_index& l, const evalue_index& r) noexcept { - return l.type_ < r.type_ || (l.type_ == r.type_ && l.name_ < r.name_); + return l.type_ < r.type_ || (l.type_ == r.type_ && std::less<>{}(l.name_, r.name_)); } inline bool operator==(const evalue_index& l, const evalue_index& r) noexcept { - return l.type_ == r.type_ && l.name_ == r.name_; + return l.type_ == r.type_ && std::equal_to<>{}(l.name_, r.name_); } } diff --git a/headers/meta.hpp/meta_indices/function_index.hpp b/headers/meta.hpp/meta_indices/function_index.hpp index a63aaad..cc1e8af 100644 --- a/headers/meta.hpp/meta_indices/function_index.hpp +++ b/headers/meta.hpp/meta_indices/function_index.hpp @@ -32,10 +32,10 @@ namespace meta_hpp } inline bool operator<(const function_index& l, const function_index& r) noexcept { - return l.type_ < r.type_ || (l.type_ == r.type_ && l.name_ < r.name_); + return l.type_ < r.type_ || (l.type_ == r.type_ && std::less<>{}(l.name_, r.name_)); } inline bool operator==(const function_index& l, const function_index& r) noexcept { - return l.type_ == r.type_ && l.name_ == r.name_; + return l.type_ == r.type_ && std::equal_to<>{}(l.name_, r.name_); } } diff --git a/headers/meta.hpp/meta_indices/member_index.hpp b/headers/meta.hpp/meta_indices/member_index.hpp index 3101f0f..f9a8999 100644 --- a/headers/meta.hpp/meta_indices/member_index.hpp +++ b/headers/meta.hpp/meta_indices/member_index.hpp @@ -32,10 +32,10 @@ namespace meta_hpp } inline bool operator<(const member_index& l, const member_index& r) noexcept { - return l.type_ < r.type_ || (l.type_ == r.type_ && l.name_ < r.name_); + return l.type_ < r.type_ || (l.type_ == r.type_ && std::less<>{}(l.name_, r.name_)); } inline bool operator==(const member_index& l, const member_index& r) noexcept { - return l.type_ == r.type_ && l.name_ == r.name_; + return l.type_ == r.type_ && std::equal_to<>{}(l.name_, r.name_); } } diff --git a/headers/meta.hpp/meta_indices/method_index.hpp b/headers/meta.hpp/meta_indices/method_index.hpp index 8ad0a3a..5e7b0a3 100644 --- a/headers/meta.hpp/meta_indices/method_index.hpp +++ b/headers/meta.hpp/meta_indices/method_index.hpp @@ -32,10 +32,10 @@ namespace meta_hpp } inline bool operator<(const method_index& l, const method_index& r) noexcept { - return l.type_ < r.type_ || (l.type_ == r.type_ && l.name_ < r.name_); + return l.type_ < r.type_ || (l.type_ == r.type_ && std::less<>{}(l.name_, r.name_)); } inline bool operator==(const method_index& l, const method_index& r) noexcept { - return l.type_ == r.type_ && l.name_ == r.name_; + return l.type_ == r.type_ && std::equal_to<>{}(l.name_, r.name_); } } diff --git a/headers/meta.hpp/meta_indices/scope_index.hpp b/headers/meta.hpp/meta_indices/scope_index.hpp index 2beb83a..01efe9c 100644 --- a/headers/meta.hpp/meta_indices/scope_index.hpp +++ b/headers/meta.hpp/meta_indices/scope_index.hpp @@ -26,10 +26,10 @@ namespace meta_hpp } inline bool operator<(const scope_index& l, const scope_index& r) noexcept { - return l.name_ < r.name_; + return std::less<>{}(l.name_, r.name_); } inline bool operator==(const scope_index& l, const scope_index& r) noexcept { - return l.name_ == r.name_; + return std::equal_to<>{}(l.name_, r.name_); } } diff --git a/headers/meta.hpp/meta_indices/variable_index.hpp b/headers/meta.hpp/meta_indices/variable_index.hpp index 1bc700f..bdaa33a 100644 --- a/headers/meta.hpp/meta_indices/variable_index.hpp +++ b/headers/meta.hpp/meta_indices/variable_index.hpp @@ -32,10 +32,10 @@ namespace meta_hpp } inline bool operator<(const variable_index& l, const variable_index& r) noexcept { - return l.type_ < r.type_ || (l.type_ == r.type_ && l.name_ < r.name_); + return l.type_ < r.type_ || (l.type_ == r.type_ && std::less<>{}(l.name_, r.name_)); } inline bool operator==(const variable_index& l, const variable_index& r) noexcept { - return l.type_ == r.type_ && l.name_ == r.name_; + return l.type_ == r.type_ && std::equal_to<>{}(l.name_, r.name_); } }