Function meta_invoke

Summary

#include <src/entt/meta/utility.hpp>

(1) template <typename Type, typename Policy = as_is_t, typename Candidate>
    meta_any meta_invoke([[maybe_unused]] meta_handle instance, Candidate &&candidate, [[maybe_unused]] meta_any *const args)

(2) template <typename Type, auto Candidate, typename Policy = as_is_t>
    meta_any meta_invoke(meta_handle instance, meta_any *const args)

Function overload

Synopsis

#include <src/entt/meta/utility.hpp>

template <typename Type, typename Policy = as_is_t, typename Candidate>
meta_any meta_invoke([[maybe_unused]] meta_handle instance, Candidate &&candidate, [[maybe_unused]] meta_any *const args)

Description

Tries to invoke an object given a list of erased parameters.

Template Parameters

Type - Reflected type to which the object to invoke is associated.

Policy - Optional policy (no policy set by default).

Candidate - The type of the actual object to invoke.

Parameters

instance - An opaque instance of the underlying type, if required.

candidate - The actual object to invoke.

args - Parameters to use to invoke the object.

Returns
A meta any containing the returned value, if any.

Source

Lines 332-335 in src/entt/meta/utility.hpp.

template<typename Type, typename Policy = as_is_t, typename Candidate>
[[nodiscard]] meta_any meta_invoke([[maybe_unused]] meta_handle instance, Candidate &&candidate, [[maybe_unused]] meta_any *const args) {
    return internal::meta_invoke<Type, Policy>(std::move(instance), std::forward<Candidate>(candidate), args, std::make_index_sequence<meta_function_helper_t<Type, std::remove_reference_t<Candidate>>::args_type::size>{});
}

Synopsis

#include <src/entt/meta/utility.hpp>

template <typename Type, auto Candidate, typename Policy = as_is_t>
meta_any meta_invoke(meta_handle instance, meta_any *const args)

Description

Tries to invoke a function given a list of erased parameters.

Template Parameters

Type - Reflected type to which the function is associated.

Candidate - The actual function to invoke.

Policy - Optional policy (no policy set by default).

Parameters

instance - An opaque instance of the underlying type, if required.

args - Parameters to use to invoke the function.

Returns
A meta any containing the returned value, if any.

Source

Lines 346-349 in src/entt/meta/utility.hpp.

template<typename Type, auto Candidate, typename Policy = as_is_t>
[[nodiscard]] meta_any meta_invoke(meta_handle instance, meta_any *const args) {
    return internal::meta_invoke<Type, Policy>(std::move(instance), Candidate, args, std::make_index_sequence<meta_function_helper_t<Type, std::remove_reference_t<decltype(Candidate)>>::args_type::size>{});
}





Add Discussion

Log in to comment