Function propagate_on_container_move_assignment

Synopsis

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

template <typename Allocator>
constexpr void propagate_on_container_move_assignment([[maybe_unused]] Allocator &lhs, [[maybe_unused]] Allocator &rhs)

Description

Utility function to design allocation-aware containers.

Template Parameters

Allocator - Type of allocator.

Parameters

lhs - A valid allocator.

rhs - Another valid allocator.

Source

Lines 48-53 in src/entt/core/memory.hpp.

template<typename Allocator>
constexpr void propagate_on_container_move_assignment([[maybe_unused]] Allocator &lhs, [[maybe_unused]] Allocator &rhs) ENTT_NOEXCEPT {
    if constexpr(std::allocator_traits<Allocator>::propagate_on_container_move_assignment::value) {
        lhs = std::move(rhs);
    }
}





Add Discussion

Log in to comment