mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 03:45:30 +07:00
fix warnings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)}},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>());
|
||||
|
||||
Reference in New Issue
Block a user