-
Notifications
You must be signed in to change notification settings - Fork 7
map_t
Alairion edited this page May 8, 2021
·
2 revisions
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>;
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.