xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::memory::DestroyAt< Type > Class Template Reference

A wrapper around std::destroy_at() that can be used as a deleter for std::unique_ptr. More...

#include <memory/DestroyAt.hpp>

Public Member Functions

auto operator() (Type *object) const -> void
 Deletes an object.
 

Detailed Description

template<typename Type>
requires (!std::is_array_v<Type>)
class xentara::utils::memory::DestroyAt< Type >

A wrapper around std::destroy_at() that can be used as a deleter for std::unique_ptr.

This class allow the use of unique_ptr to destroy objects that were allocated using placement new or std::construct_at()

Member Function Documentation

◆ operator()()

template<typename Type >
auto xentara::utils::memory::DestroyAt< Type >::operator() ( Type *  object) const -> void

Deletes an object.

Parameters
objectThe object