fix warnings

This commit is contained in:
BlackMATov
2022-01-22 15:26:45 +07:00
parent a0a24ea94e
commit 15235534e7
4 changed files with 16 additions and 15 deletions

View File

@@ -32,6 +32,7 @@ target_compile_options(${PROJECT_NAME}
-Wno-extra-semi-stmt
-Wno-float-equal
-Wno-global-constructors
-Wno-ordered-compare-function-pointers
-Wno-padded
-Wno-reserved-identifier
-Wno-shadow-field

View File

@@ -79,21 +79,21 @@ namespace meta_hpp
struct as_copy final {};
struct as_pointer final {};
struct as_reference_wrapper final {};
};
}
namespace method_policy
{
struct as_copy final {};
struct discard_return final {};
struct return_reference_as_pointer final {};
};
}
namespace variable_policy
{
struct as_copy final {};
struct as_pointer final {};
struct as_reference_wrapper final {};
};
}
template < typename Policy >
concept ctor_policy_kind =
@@ -384,7 +384,7 @@ namespace meta_hpp::detail
const value underlying_value;
template < enum_kind Enum >
[[nodiscard]] static evalue_state_ptr make(std::string name, Enum value);
[[nodiscard]] static evalue_state_ptr make(std::string name, Enum evalue);
};
struct function_state final {
@@ -431,10 +431,10 @@ namespace meta_hpp::detail
struct scope_state final {
const scope_index index;
class_map classes;
enum_map enums;
function_map functions;
variable_map variables;
class_map classes{};
enum_map enums{};
function_map functions{};
variable_map variables{};
[[nodiscard]] static scope_state_ptr make(std::string name);
[[nodiscard]] static scope_state_ptr get_static(std::string_view name);

View File

@@ -14,12 +14,12 @@
namespace meta_hpp::detail
{
template < enum_kind Enum >
evalue_state_ptr evalue_state::make(std::string name, Enum value) {
evalue_state_ptr evalue_state::make(std::string name, Enum evalue) {
evalue_index index{enum_type_data::get_static<Enum>(), std::move(name)};
return std::make_shared<evalue_state>(evalue_state{
.index{std::move(index)},
.enum_value{value},
.underlying_value{stdex::to_underlying(value)},
.enum_value{value{evalue}},
.underlying_value{value{stdex::to_underlying(evalue)}},
});
}
}

View File

@@ -243,14 +243,14 @@ namespace meta_hpp
namespace meta_hpp
{
template < detail::has_value_less_traits T >
template < typename T >
[[nodiscard]] bool operator<(const value& l, const T& r) {
const any_type& r_type = resolve_type<T>();
return (l.get_type() < r_type)
|| (l.get_type() == r_type && std::less<>{}(l.cast<T>(), r));
}
template < detail::has_value_less_traits T >
template < typename T >
[[nodiscard]] bool operator<(const T& l, const value& r) {
const any_type& l_type = resolve_type<T>();
return (l_type < r.get_type())
@@ -265,13 +265,13 @@ namespace meta_hpp
namespace meta_hpp
{
template < detail::has_value_equals_traits T >
template < typename T >
[[nodiscard]] bool operator==(const value& l, const T& r) {
return l.get_type() == resolve_type<T>()
&& std::equal_to<>{}(l.cast<T>(), r);
}
template < detail::has_value_equals_traits T >
template < typename T >
[[nodiscard]] bool operator==(const T& l, const value& r) {
return resolve_type<T>() == r.get_type()
&& std::equal_to<>{}(l, r.cast<T>());