Function basic_poly

Summary

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

(1) basic_poly()

(2) template <typename Type, typename... Args>
    explicit basic_poly(std::in_place_type_t< Type >, Args &&...args)

(3) template <typename Type, typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, basic_poly>>>
    basic_poly(Type &&value)

Function overload

Synopsis

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

basic_poly()

Description

Default constructor.

Source

Lines 203-205 in src/entt/poly/poly.hpp.

basic_poly() ENTT_NOEXCEPT
    : storage{},
      vtable{} {}

Synopsis

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

template <typename Type, typename... Args>
explicit basic_poly(std::in_place_type_t< Type >, Args &&...args)

Description

Constructs a poly by directly initializing the new object.

Template Parameters

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

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

Parameters

args - Parameters to use to construct the instance.

Source

Lines 213-216 in src/entt/poly/poly.hpp.

template<typename Type, typename... Args>
explicit basic_poly(std::in_place_type_t<Type>, Args &&...args)
    : storage{std::in_place_type<Type>, std::forward<Args>(args)...},
      vtable{poly_vtable<Concept, Len, Align>::template instance<std::remove_const_t<std::remove_reference_t<Type>>>()} {}

Synopsis

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

template <typename Type, typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, basic_poly>>>
basic_poly(Type &&value)

Description

Constructs a poly from a given value.

Template Parameters

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

Parameters

value - An instance of an object to use to initialize the poly.

Source

Lines 223-225 in src/entt/poly/poly.hpp.

template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, basic_poly>>>
basic_poly(Type &&value) ENTT_NOEXCEPT
    : basic_poly{std::in_place_type<std::remove_cv_t<std::remove_reference_t<Type>>>, std::forward<Type>(value)} {}





Add Discussion

Log in to comment