#include <stddef.h>
#include <memory>
#include <type_traits>
#include <utility>
Go to the source code of this file.
|  | 
| template<class T , class Deleter  = std::default_delete<T>> | 
| using | UT_UniquePtr = std::unique_ptr< T, Deleter > | 
|  | A smart pointer for unique ownership of dynamically allocated objects.  More... 
 | 
|  | 
|  | 
| template<class T , class... REST, std::enable_if_t<!std::is_array_v< T >, int >  = 0> | 
| UT_UniquePtr< T > | UTmakeUnique (REST &&...args) | 
|  | 
| template<class T , std::enable_if_t< std::is_array_v< T > &&std::extent_v< T >==0, int >  = 0> | 
| UT_UniquePtr< T > | UTmakeUnique (size_t len) | 
|  | Construct a value initialized 1D array of type T with len elements.  More... 
 | 
|  | 
| template<class T , class... REST, std::enable_if_t< std::extent_v< T >!=0, int >  = 0> | 
| void | UTmakeUnique (REST &&...)=delete | 
|  | Construction of arrays of known bound is disallowed. Just do it directly!  More... 
 | 
|  | 
| template<class T , std::enable_if_t<!std::is_array_v< T >, int >  = 0> | 
| UT_UniquePtr< T > | UTmakeUniqueForOverwrite () | 
|  | Construct a default initialized T in a UT_UniquePtr.  More... 
 | 
|  | 
| template<class T , std::enable_if_t< std::is_array_v< T > &&std::extent_v< T >==0, int >  = 0> | 
| UT_UniquePtr< T > | UTmakeUniqueForOverwrite (size_t len) | 
|  | Construct a default initialized 1D array of type T with len elements.  More... 
 | 
|  | 
| template<class T , class... REST, std::enable_if_t< std::extent_v< T >!=0, int >  = 0> | 
| void | UTmakeUniqueForOverwrite (REST &&...)=delete | 
|  | Construction of arrays of known bound is disallowed. Just do it directly!  More... 
 | 
|  | 
template<class T , class Deleter  = std::default_delete<T>> 
      
 
A smart pointer for unique ownership of dynamically allocated objects. 
UT_UniquePtr mimics a built-in pointer except that it guarantees deletion of the object pointed to, either upon destruction or via an explicit reset(). UT_UniquePtr is a simple solution for simple needs; use UT_SharedPtr/UT_IntrusivePtr if your needs are more complex. 
Definition at line 39 of file UT_UniquePtr.h.
 
 
template<class T , class... REST, std::enable_if_t<!std::is_array_v< T >, int >  = 0> 
 
Constructs an object of type T and wraps it in an UT_UniquePtr. The args are passed to the constructor of T. 
Definition at line 50 of file UT_UniquePtr.h.
 
 
template<class T , std::enable_if_t< std::is_array_v< T > &&std::extent_v< T >==0, int >  = 0> 
 
Construct a value initialized 1D array of type T with len elements. 
Definition at line 61 of file UT_UniquePtr.h.
 
 
template<class T , class... REST, std::enable_if_t< std::extent_v< T >!=0, int >  = 0> 
  
  | 
        
          | void UTmakeUnique | ( | REST && | ... | ) |  |  | delete | 
 
Construction of arrays of known bound is disallowed. Just do it directly! 
 
 
template<class T , std::enable_if_t<!std::is_array_v< T >, int >  = 0> 
 
Construct a default initialized T in a UT_UniquePtr. 
Definition at line 81 of file UT_UniquePtr.h.
 
 
template<class T , std::enable_if_t< std::is_array_v< T > &&std::extent_v< T >==0, int >  = 0> 
 
Construct a default initialized 1D array of type T with len elements. 
Definition at line 92 of file UT_UniquePtr.h.
 
 
template<class T , class... REST, std::enable_if_t< std::extent_v< T >!=0, int >  = 0> 
  
  | 
        
          | void UTmakeUniqueForOverwrite | ( | REST && | ... | ) |  |  | delete | 
 
Construction of arrays of known bound is disallowed. Just do it directly!