fix more warnings

This commit is contained in:
BlackMATov
2022-02-05 08:52:42 +07:00
parent c2b4aff6a0
commit 9116a7bcc4
10 changed files with 22 additions and 24 deletions

View File

@@ -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

View File

@@ -133,7 +133,7 @@ namespace enum_hpp::bitflags
}\
template < typename Enum >\
constexpr bitflags<Enum> operator op (bitflags<Enum> l, Enum r) noexcept {\
return l op bitflags{r};\
return l op bitflags<Enum>{r};\
}\
template < typename Enum >\
constexpr bitflags<Enum> operator op (bitflags<Enum> l, bitflags<Enum> r) noexcept {\
@@ -141,7 +141,7 @@ namespace enum_hpp::bitflags
}\
template < typename Enum >\
constexpr bitflags<Enum>& operator op##= (bitflags<Enum>& l, Enum r) noexcept {\
return l = l op bitflags{r};\
return l = l op bitflags<Enum>{r};\
}\
template < typename Enum >\
constexpr bitflags<Enum>& operator op##= (bitflags<Enum>& l, bitflags<Enum> r) noexcept {\
@@ -319,14 +319,14 @@ namespace enum_hpp::bitflags
#define ENUM_HPP_OPERATORS_DECL(Enum)\
constexpr ::enum_hpp::bitflags::bitflags<Enum> operator~ [[maybe_unused]] (Enum l) noexcept {\
return ~::enum_hpp::bitflags::bitflags(l);\
return ~::enum_hpp::bitflags::bitflags<Enum>(l);\
}\
constexpr ::enum_hpp::bitflags::bitflags<Enum> operator| [[maybe_unused]] (Enum l, Enum r) noexcept {\
return ::enum_hpp::bitflags::bitflags(l) | ::enum_hpp::bitflags::bitflags(r);\
return ::enum_hpp::bitflags::bitflags<Enum>(l) | ::enum_hpp::bitflags::bitflags<Enum>(r);\
}\
constexpr ::enum_hpp::bitflags::bitflags<Enum> operator& [[maybe_unused]] (Enum l, Enum r) noexcept {\
return ::enum_hpp::bitflags::bitflags(l) & ::enum_hpp::bitflags::bitflags(r);\
return ::enum_hpp::bitflags::bitflags<Enum>(l) & ::enum_hpp::bitflags::bitflags<Enum>(r);\
}\
constexpr ::enum_hpp::bitflags::bitflags<Enum> operator^ [[maybe_unused]] (Enum l, Enum r) noexcept {\
return ::enum_hpp::bitflags::bitflags(l) ^ ::enum_hpp::bitflags::bitflags(r);\
return ::enum_hpp::bitflags::bitflags<Enum>(l) ^ ::enum_hpp::bitflags::bitflags<Enum>(r);\
}

View File

@@ -24,11 +24,11 @@ namespace meta_hpp::detail
{
template < typename T >
requires requires(const T& l, const T& r) {
{ l == r } -> stdex::convertible_to<bool>;
{ std::equal_to<>{}(l, r) } -> stdex::convertible_to<bool>;
}
struct equals_traits<T> {
bool operator()(const T& l, const T& r) const {
return l == r;
return std::equal_to<>{}(l, r);
}
};
}

View File

@@ -24,11 +24,11 @@ namespace meta_hpp::detail
{
template < typename T >
requires requires(const T& l, const T& r) {
{ l < r } -> stdex::convertible_to<bool>;
{ std::less<>{}(l, r) } -> stdex::convertible_to<bool>;
}
struct less_traits<T> {
bool operator()(const T& l, const T& r) const {
return l < r;
return std::less<>{}(l, r);
}
};
}

View File

@@ -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_);
}
}

View File

@@ -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_);
}
}

View File

@@ -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_);
}
}

View File

@@ -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_);
}
}

View File

@@ -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_);
}
}

View File

@@ -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_);
}
}