Function forward_as_meta

Synopsis

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

template <typename Type>
meta_any forward_as_meta(Type &&value)

Description

Forwards its argument and avoids copies for lvalue references.

Template Parameters

Type - Type of argument to use to construct the new instance.

Parameters

value - Parameter to use to construct the instance.

Returns
A properly initialized and not necessarily owning wrapper.

Mentioned in

Source

Lines 590-593 in src/entt/meta/meta.hpp.

template<typename Type>
meta_any forward_as_meta(Type &&value) {
    return meta_any{std::in_place_type<std::conditional_t<std::is_rvalue_reference_v<Type>, std::decay_t<Type>, Type>>, std::forward<Type>(value)};
}





Add Discussion

Log in to comment