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:
@@ -23,10 +23,9 @@ namespace meta_hpp::field_detail
|
|||||||
};
|
};
|
||||||
|
|
||||||
template < typename T, typename Base >
|
template < typename T, typename Base >
|
||||||
struct field_traits<const T Base::*> {
|
struct field_traits<const T Base::*>
|
||||||
|
: field_traits<T Base::*> {
|
||||||
static constexpr bool is_const = true;
|
static constexpr bool is_const = true;
|
||||||
using value_type = T;
|
|
||||||
using instance_type = Base;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template < auto Field >
|
template < auto Field >
|
||||||
@@ -42,7 +41,7 @@ namespace meta_hpp::field_detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
template < auto Field >
|
template < auto Field >
|
||||||
void setter(void* instance, value value) {
|
void setter([[maybe_unused]] void* instance, value value) {
|
||||||
using ft = field_traits<decltype(Field)>;
|
using ft = field_traits<decltype(Field)>;
|
||||||
using value_type = typename ft::value_type;
|
using value_type = typename ft::value_type;
|
||||||
using instance_type = typename ft::instance_type;
|
using instance_type = typename ft::instance_type;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace meta_hpp::function_detail
|
|||||||
using return_type = typename ft::return_type;
|
using return_type = typename ft::return_type;
|
||||||
using argument_types = typename ft::argument_types;
|
using argument_types = typename ft::argument_types;
|
||||||
|
|
||||||
auto typed_arguments = std::make_tuple(
|
[[maybe_unused]] auto typed_arguments = std::make_tuple(
|
||||||
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
||||||
|
|
||||||
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ namespace meta_hpp::method_detail
|
|||||||
: method_traits<R(Base::*)(Args...) const> {};
|
: method_traits<R(Base::*)(Args...) const> {};
|
||||||
|
|
||||||
template < auto Method, std::size_t... Is >
|
template < auto Method, std::size_t... Is >
|
||||||
value invoke(void* instance, value* args, std::index_sequence<Is...>) {
|
value invoke([[maybe_unused]] void* instance, value* args, std::index_sequence<Is...>) {
|
||||||
using mt = method_traits<decltype(Method)>;
|
using mt = method_traits<decltype(Method)>;
|
||||||
using return_type = typename mt::return_type;
|
using return_type = typename mt::return_type;
|
||||||
using instance_type = typename mt::instance_type;
|
using instance_type = typename mt::instance_type;
|
||||||
using argument_types = typename mt::argument_types;
|
using argument_types = typename mt::argument_types;
|
||||||
|
|
||||||
auto typed_arguments = std::make_tuple(
|
[[maybe_unused]] auto typed_arguments = std::make_tuple(
|
||||||
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
||||||
|
|
||||||
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
||||||
@@ -77,13 +77,13 @@ namespace meta_hpp::method_detail
|
|||||||
}
|
}
|
||||||
|
|
||||||
template < auto Method, std::size_t... Is >
|
template < auto Method, std::size_t... Is >
|
||||||
value cinvoke(const void* instance, value* args, std::index_sequence<Is...>) {
|
value cinvoke([[maybe_unused]] const void* instance, value* args, std::index_sequence<Is...>) {
|
||||||
using mt = method_traits<decltype(Method)>;
|
using mt = method_traits<decltype(Method)>;
|
||||||
using return_type = typename mt::return_type;
|
using return_type = typename mt::return_type;
|
||||||
using instance_type = typename mt::instance_type;
|
using instance_type = typename mt::instance_type;
|
||||||
using argument_types = typename mt::argument_types;
|
using argument_types = typename mt::argument_types;
|
||||||
|
|
||||||
auto typed_arguments = std::make_tuple(
|
[[maybe_unused]] auto typed_arguments = std::make_tuple(
|
||||||
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
(args + Is)->try_cast<std::tuple_element_t<Is, argument_types>>()...);
|
||||||
|
|
||||||
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
if ( !(std::get<Is>(typed_arguments) && ...) ) {
|
||||||
|
|||||||
@@ -99,8 +99,6 @@ namespace meta_hpp
|
|||||||
template < auto Variable >
|
template < auto Variable >
|
||||||
class variable_ {
|
class variable_ {
|
||||||
public:
|
public:
|
||||||
static_assert(std::is_pointer_v<decltype(Variable)>);
|
|
||||||
|
|
||||||
explicit variable_(std::string id)
|
explicit variable_(std::string id)
|
||||||
: info_(std::move(id)) {
|
: info_(std::move(id)) {
|
||||||
info_.getter_ = &variable_detail::getter<Variable>;
|
info_.getter_ = &variable_detail::getter<Variable>;
|
||||||
|
|||||||
Reference in New Issue
Block a user