fennec
Loading...
Searching...
No Matches
fennec::unique_ptr< TypeT, DeleteT >

#include <pointers.h>

Detailed Description

template<typename TypeT, class DeleteT = default_delete<TypeT>>
class fennec::unique_ptr< TypeT, DeleteT >
Template Parameters
TypeT
DeleteT

Public Types

using element_t = TypeT
 the element type
 
using pointer_t = element_t *
 pointer to element type
 
using const_pointer_t = const element_t *
 pointer to element type
 
using delete_t = DeleteT
 the deleter
 

Public Member Functions

constexpr unique_ptr ()
 Default Constructor, creates a unique_ptr that owns nothing.
 
constexpr unique_ptr (nullptr_t) noexcept
 Nullptr Constructor, creates a unique_ptr that owns nothing.
 
constexpr unique_ptr (pointer_t ptr, const delete_t &del=delete_t())
 Pointer Constructor, creates a unique_ptr that owns ptr with deleter del
 
constexpr unique_ptr (unique_ptr &&other)
 Move Constructor, transfers ownership from other
 
constexpr ~unique_ptr ()
 Default Constructor, if it owns a resource, it deletes it using delete_t
 

Constructor & Destructor Documentation

◆ unique_ptr() [1/2]

template<typename TypeT , class DeleteT = default_delete<TypeT>>
constexpr fennec::unique_ptr< TypeT, DeleteT >::unique_ptr ( pointer_t  ptr,
const delete_t del = delete_t() 
)
inlineexplicitconstexpr
Parameters
ptrThe resource to own
delThe deleter

◆ unique_ptr() [2/2]

template<typename TypeT , class DeleteT = default_delete<TypeT>>
constexpr fennec::unique_ptr< TypeT, DeleteT >::unique_ptr ( unique_ptr< TypeT, DeleteT > &&  other)
inlineconstexpr
Parameters
otherThe unique_ptr to take ownership from

The documentation for this class was generated from the following file: