Skip to content
Alairion edited this page May 8, 2021 · 2 revisions

nes::unique_map_t, nes::shared_map_t, nes::weak_map_t

Defined in header <nes/shared_memory.hpp>

template<typename T>
struct map_deleter
{
    void operator()(T* ptr) const noexcept;
};

template<typename T>
struct map_deleter<T[]>
{
    void operator()(T* ptr) const noexcept;
};

template<typename T>
using unique_map_t = std::unique_ptr<T, map_deleter<T>>;
template<typename T>
using shared_map_t = std::shared_ptr<T>;
template<typename T>
using weak_map_t = std::weak_ptr<T>;

Description

nes::map_deleter is a deleter for standard smart pointer that unmap the memory pointed by the smart pointer, on destruction.

nes::unique_map_t, nes::shared_map_t and nes::weak_map_t are typedefs of std::unique_ptr, std::shared_ptr and std::weak_ptr, respectively, that use a nes::map_deleter. They are the types returned by nes::shared_memory::map functions.

Clone this wiki locally