Function operator=

Summary

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

(1) meta_any & operator=(const meta_any &other)

(2) meta_any & operator=(meta_any &&other)

(3) template <typename Type>
    std::enable_if_t<!std::is_same_v< std::decay_t< Type >, meta_any >, meta_any & > operator=(Type &&value)

Function overload

Synopsis

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

meta_any & operator=(const meta_any &other)

Description

Copy assignment operator.

Parameters

other - The instance to copy from.

Returns
This meta any object.

Source

Lines 251-257 in src/entt/meta/meta.hpp.

meta_any &operator=(const meta_any &other) {
    release();
    vtable = other.vtable;
    storage = other.storage;
    node = other.node;
    return *this;
}

Synopsis

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

meta_any & operator=(meta_any &&other)

Description

Move assignment operator.

Parameters

other - The instance to move from.

Returns
This meta any object.

Source

Lines 264-270 in src/entt/meta/meta.hpp.

meta_any &operator=(meta_any &&other) ENTT_NOEXCEPT {
    release();
    vtable = std::exchange(other.vtable, &basic_vtable<void>);
    storage = std::move(other.storage);
    node = std::exchange(other.node, nullptr);
    return *this;
}

Synopsis

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

template <typename Type>
std::enable_if_t<!std::is_same_v< std::decay_t< Type >, meta_any >, meta_any & > operator=(Type &&value)

Description

Value assignment operator.

Template Parameters

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

Parameters

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

Returns
This meta any object.

Source

Lines 278-283 in src/entt/meta/meta.hpp.

template<typename Type>
std::enable_if_t<!std::is_same_v<std::decay_t<Type>, meta_any>, meta_any &>
operator=(Type &&value) {
    emplace<std::decay_t<Type>>(std::forward<Type>(value));
    return *this;
}





Add Discussion

Log in to comment