mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 03:45:30 +07:00
fix some misstypings
This commit is contained in:
@@ -200,7 +200,7 @@ namespace meta_hpp
|
||||
|
||||
template < typename... Args >
|
||||
function get_function_with(std::string_view name) const noexcept;
|
||||
function get_function_with(std::string_view name, std::vector<any_type> args) const noexcept;
|
||||
function get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
|
||||
function get_function_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
|
||||
private:
|
||||
detail::scope_state_ptr state_;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace meta_hpp
|
||||
bool ctor::is_invocable_with(Args&&... args) const noexcept {
|
||||
using namespace detail;
|
||||
if constexpr ( sizeof...(Args) > 0 ) {
|
||||
std::array<arg, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
std::array<arg_base, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
return state_->is_invocable_with(vargs.data(), vargs.size());
|
||||
} else {
|
||||
return state_->is_invocable_with(nullptr, 0);
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace meta_hpp
|
||||
bool function::is_invocable_with(Args&&... args) const noexcept {
|
||||
using namespace detail;
|
||||
if constexpr ( sizeof...(Args) > 0 ) {
|
||||
std::array<arg, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
std::array<arg_base, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
return state_->is_invocable_with(vargs.data(), vargs.size());
|
||||
} else {
|
||||
return state_->is_invocable_with(nullptr, 0);
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace meta_hpp
|
||||
bool method::is_invocable_with(Instance&& instance, Args&&... args) const noexcept {
|
||||
using namespace detail;
|
||||
if constexpr ( sizeof...(Args) > 0 ) {
|
||||
std::array<arg, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
std::array<arg_base, sizeof...(Args)> vargs{arg{std::forward<Args>(args)}...};
|
||||
return state_->is_invocable_with(inst{std::forward<Instance>(instance)}, vargs.data(), vargs.size());
|
||||
} else {
|
||||
return state_->is_invocable_with(inst{std::forward<Instance>(instance)}, nullptr, 0);
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace meta_hpp
|
||||
return get_function_with(name, {resolve_type<Args>()...});
|
||||
}
|
||||
|
||||
inline function scope::get_function_with(std::string_view name, std::vector<any_type> args) const noexcept {
|
||||
inline function scope::get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept {
|
||||
for ( auto&& [index, function] : state_->functions ) {
|
||||
if ( index.name != name ) {
|
||||
continue;
|
||||
|
||||
@@ -228,17 +228,17 @@ namespace meta_hpp
|
||||
|
||||
template < typename... Args >
|
||||
ctor get_ctor_with() const noexcept;
|
||||
ctor get_ctor_with(std::vector<any_type> args) const noexcept;
|
||||
ctor get_ctor_with(const std::vector<any_type>& args) const noexcept;
|
||||
ctor get_ctor_with(std::initializer_list<any_type> args) const noexcept;
|
||||
|
||||
template < typename... Args >
|
||||
function get_function_with(std::string_view name) const noexcept;
|
||||
function get_function_with(std::string_view name, std::vector<any_type> args) const noexcept;
|
||||
function get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
|
||||
function get_function_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
|
||||
|
||||
template < typename... Args >
|
||||
method get_method_with(std::string_view name) const noexcept;
|
||||
method get_method_with(std::string_view name, std::vector<any_type> args) const noexcept;
|
||||
method get_method_with(std::string_view name, const std::vector<any_type>& args) const noexcept;
|
||||
method get_method_with(std::string_view name, std::initializer_list<any_type> args) const noexcept;
|
||||
private:
|
||||
detail::class_type_data_ptr data_;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace meta_hpp
|
||||
template < typename... Args >
|
||||
std::optional<value> class_type::create(Args&&... args) const {
|
||||
for ( auto&& ctor : data_->ctors ) {
|
||||
if ( ctor.second.is_invocable_with<Args...>() ) {
|
||||
if ( ctor.second.is_invocable_with(std::forward<Args>(args)...) ) {
|
||||
return ctor.second.invoke(std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace meta_hpp
|
||||
return get_ctor_with({resolve_type<Args>()...});
|
||||
}
|
||||
|
||||
inline ctor class_type::get_ctor_with(std::vector<any_type> args) const noexcept {
|
||||
inline ctor class_type::get_ctor_with(const std::vector<any_type>& args) const noexcept {
|
||||
for ( auto&& [index, ctor] : data_->ctors ) {
|
||||
if ( ctor.get_type().get_arity() != args.size() ) {
|
||||
continue;
|
||||
@@ -264,7 +264,7 @@ namespace meta_hpp
|
||||
return get_function_with(name, {resolve_type<Args>()...});
|
||||
}
|
||||
|
||||
inline function class_type::get_function_with(std::string_view name, std::vector<any_type> args) const noexcept {
|
||||
inline function class_type::get_function_with(std::string_view name, const std::vector<any_type>& args) const noexcept {
|
||||
for ( auto&& [index, function] : data_->functions ) {
|
||||
if ( index.name != name ) {
|
||||
continue;
|
||||
@@ -323,7 +323,7 @@ namespace meta_hpp
|
||||
return get_method_with(name, {resolve_type<Args>()...});
|
||||
}
|
||||
|
||||
inline method class_type::get_method_with(std::string_view name, std::vector<any_type> args) const noexcept {
|
||||
inline method class_type::get_method_with(std::string_view name, const std::vector<any_type>& args) const noexcept {
|
||||
for ( auto&& [index, method] : data_->methods ) {
|
||||
if ( index.name != name ) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user