Function meta_construct

Summary

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

(1) template <typename Type, typename... Args>
    meta_any meta_construct(meta_any *const args)

(2) template <typename Type, typename Policy = as_is_t, typename Candidate>
    meta_any meta_construct(Candidate &&candidate, meta_any *const args)

(3) template <typename Type, auto Candidate, typename Policy = as_is_t>
    meta_any meta_construct(meta_any *const args)

Function overload

Synopsis

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

template <typename Type, typename... Args>
meta_any meta_construct(meta_any *const args)

Description

Constructs an instance given a list of erased parameters, if possible.

Template Parameters

Type - Actual type of the instance to construct.

Args - Types of arguments expected.

Parameters

args - Parameters to use to construct the instance.

Returns
A meta any containing the new instance, if any.

Source

Lines 362-365 in src/entt/meta/utility.hpp.

template<typename Type, typename... Args>
[[nodiscard]] meta_any meta_construct(meta_any * const args) {
    return internal::meta_construct<Type, Args...>(args, std::index_sequence_for<Args...>{});
}

Synopsis

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

template <typename Type, typename Policy = as_is_t, typename Candidate>
meta_any meta_construct(Candidate &&candidate, meta_any *const args)

Description

Constructs an instance given a list of erased parameters, if possible.

Template Parameters

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

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

Candidate - The actual callable object to invoke.

Parameters

args - Parameters to use to invoke the callable object.

candidate - The actual callable object to invoke.

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

Source

Lines 377-380 in src/entt/meta/utility.hpp.

template<typename Type, typename Policy = as_is_t, typename Candidate>
[[nodiscard]] meta_any meta_construct(Candidate &&candidate, meta_any * const args) {
    return meta_invoke<Type, Policy>({}, std::forward<Candidate>(candidate), args);
}

Synopsis

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

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

Description

Constructs an instance given a list of erased parameters, if possible.

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

args - Parameters to use to invoke the function.

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

Source

Lines 391-394 in src/entt/meta/utility.hpp.

template<typename Type, auto Candidate, typename Policy = as_is_t>
[[nodiscard]] meta_any meta_construct(meta_any * const args) {
    return meta_construct<Type, Policy>(Candidate, args);
}





Add Discussion

Log in to comment