Function make_any

Synopsis

#include <src/entt/core/any.hpp>

template <typename Type, std::size_t Len = basic_any<>::length, std::size_t Align = basic_any<Len>::alignment, typename... Args>
basic_any< Len, Align > make_any(Args &&... args)

Description

Constructs a wrapper from a given type, passing it all arguments.

Template Parameters

Type - Type of object to use to initialize the wrapper.

Len - Size of the storage reserved for the small buffer optimization.

Align - Optional alignment requirement.

Args - Types of arguments to use to construct the new instance.

Parameters

args - Parameters to use to construct the instance.

Returns
A properly initialized wrapper for an object of the given type.

Mentioned in

Source

Lines 406-409 in src/entt/core/any.hpp.

template<typename Type, std::size_t Len = basic_any<>::length, std::size_t Align = basic_any<Len>::alignment, typename... Args>
basic_any<Len, Align> make_any(Args &&... args) {
    return basic_any<Len, Align>{std::in_place_type<Type>, std::forward<Args>(args)...};
}





Add Discussion

Log in to comment