Function resolve

Summary

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

(1) template <typename Type>
    meta_type resolve() noexcept

(2) meta_type resolve(const id_type id) noexcept

(3) meta_type resolve(const type_info info) noexcept

Function overload

Synopsis

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

template <typename Type>
meta_type resolve() noexcept

Description

Returns the meta type associated with a given type.

Returns a range to use to visit all meta types.

Template Parameters

Type - Type to use to search for a meta type.

Returns
The meta type associated with the given type, if any.
Returns
An iterable range to use to visit all meta types.

Mentioned in

Source

Lines 20-23 in src/entt/meta/resolve.hpp.

template<typename Type>
[[nodiscard]] meta_type resolve() ENTT_NOEXCEPT {
    return internal::meta_info<Type>::resolve();
}

Synopsis

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

meta_type resolve(const id_type id) noexcept

Description

Returns the meta type associated with a given identifier, if any.

Parameters

id - Unique identifier.

Returns
The meta type associated with the given identifier, if any.

Mentioned in

Source

Lines 40-43 in src/entt/meta/resolve.hpp.

[[nodiscard]] inline meta_type resolve(const id_type id) ENTT_NOEXCEPT {
    internal::meta_range range{*internal::meta_context::global()};
    return std::find_if(range.begin(), range.end(), [id](const auto &curr) { return curr.id == id; }).operator->();
}

Synopsis

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

meta_type resolve(const type_info info) noexcept

Description

Returns the meta type associated with a given type info object, if any.

Parameters

info - The type info object of the requested type.

Returns
The meta type associated with the given type info object, if any.

Mentioned in

Source

Lines 52-55 in src/entt/meta/resolve.hpp.

[[nodiscard]] inline meta_type resolve(const type_info info) ENTT_NOEXCEPT {
    internal::meta_range range{*internal::meta_context::global()};
    return std::find_if(range.begin(), range.end(), [info](const auto &curr) { return curr.info == info; }).operator->();
}





Add Discussion

Log in to comment