mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 22:17:02 +07:00
fix unused warning
This commit is contained in:
@@ -34,9 +34,10 @@ namespace meta_hpp
|
||||
|
||||
template < typename... Args >
|
||||
ctor_info get_ctor_by_args() const noexcept;
|
||||
template < std::size_t Args >
|
||||
ctor_info get_ctor_by_args(const std::array<any_type, Args>& args) const noexcept;
|
||||
template < std::size_t N >
|
||||
ctor_info get_ctor_by_args(const std::array<any_type, N>& args) const noexcept;
|
||||
ctor_info get_ctor_by_args(const std::vector<any_type>& args) const noexcept;
|
||||
ctor_info get_ctor_by_args(std::initializer_list<any_type> args) const noexcept;
|
||||
public:
|
||||
template < typename F >
|
||||
void visit(F&& f) const;
|
||||
@@ -137,8 +138,8 @@ namespace meta_hpp
|
||||
return get_ctor_by_args(args);
|
||||
}
|
||||
|
||||
template < std::size_t Args >
|
||||
ctor_info class_info::get_ctor_by_args(const std::array<any_type, Args>& args) const noexcept {
|
||||
template < std::size_t N >
|
||||
ctor_info class_info::get_ctor_by_args(const std::array<any_type, N>& args) const noexcept {
|
||||
for ( auto&& id_info : state_->ctors ) {
|
||||
const std::vector<any_type>& ctor_args =
|
||||
id_info.second.type().argument_types();
|
||||
@@ -165,6 +166,20 @@ namespace meta_hpp
|
||||
}
|
||||
return ctor_info{};
|
||||
}
|
||||
|
||||
inline ctor_info class_info::get_ctor_by_args(std::initializer_list<any_type> args) const noexcept {
|
||||
for ( auto&& id_info : state_->ctors ) {
|
||||
const std::vector<any_type>& ctor_args =
|
||||
id_info.second.type().argument_types();
|
||||
|
||||
if ( args.size() == ctor_args.size()
|
||||
&& std::equal(args.begin(), args.end(), ctor_args.begin()) )
|
||||
{
|
||||
return id_info.second;
|
||||
}
|
||||
}
|
||||
return ctor_info{};
|
||||
}
|
||||
}
|
||||
|
||||
namespace meta_hpp
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace meta_hpp::detail
|
||||
}
|
||||
|
||||
template < typename Member >
|
||||
void raw_member_setter(Member member, const inst& inst, const arg& arg) {
|
||||
void raw_member_setter([[maybe_unused]] Member member, const inst& inst, const arg& arg) {
|
||||
using mt = member_pointer_traits<Member>;
|
||||
using class_type = typename mt::class_type;
|
||||
using value_type = typename mt::value_type;
|
||||
|
||||
Reference in New Issue
Block a user