Potato Engine
Hobby Game Engine Project
Public Types | Public Member Functions | Friends | List of all members
up::box< T > Class Template Reference

An owning non-copyable pointer to a heap-allocated object, analogous to std::unique_ptr but without custom deleter support. More...

#include <box.h>

Inheritance diagram for up::box< T >:

Public Types

using pointer = typename up::_detail::box_traits< T >::pointer
 
using reference = typename up::_detail::box_traits< T >::reference
 

Public Member Functions

 box (std::nullptr_t)
 
boxoperator= (std::nullptr_t)
 
 box (pointer ptr)
 
 box (box &&src)
 
boxoperator= (box &&src)
 
template<typename U >
 box (box< U > &&src)
 
template<typename U >
enable_if_t< std::is_assignable_v< T *, U * >, box & > operator= (box< U > &&src)
 
pointer get () const
 
pointer operator-> () const
 
reference operator* () const
 
 operator bool () const
 
bool empty () const
 
void reset (pointer ptr=pointer{})
 
pointer release ()
 

Friends

template<typename U >
bool operator== (box const &lhs, box< U > const &rhs)
 
template<typename U >
bool operator!= (box const &lhs, box< U > const &rhs)
 
template<typename U >
bool operator<= (box const &lhs, box< U > const &rhs)
 
template<typename U >
bool operator< (box const &lhs, box< U > const &rhs)
 
template<typename U >
bool operator== (box const &lhs, U const *rhs)
 
template<typename U >
bool operator!= (box const &lhs, U const *rhs)
 
template<typename U >
bool operator<= (box const &lhs, U const *rhs)
 
template<typename U >
bool operator< (box const &lhs, U const *rhs)
 
template<typename U >
bool operator== (U const *lhs, box const &rhs)
 
template<typename U >
bool operator!= (U const *lhs, box const &rhs)
 
template<typename U >
bool operator<= (U const *lhs, box const &rhs)
 
template<typename U >
bool operator< (U const *lhs, box const &rhs)
 
bool operator== (box const &lhs, std::nullptr_t)
 
bool operator!= (box const &lhs, std::nullptr_t)
 
bool operator<= (box const &lhs, std::nullptr_t)
 
bool operator< (box const &, std::nullptr_t)
 
bool operator== (std::nullptr_t, box const &rhs)
 
bool operator!= (std::nullptr_t, box const &rhs)
 
bool operator<= (std::nullptr_t, box const &)
 
bool operator< (std::nullptr_t, box const &rhs)
 

Detailed Description

template<typename T>
class up::box< T >

An owning non-copyable pointer to a heap-allocated object, analogous to std::unique_ptr but without custom deleter support.

Template Parameters
TType of the object owned by the box.

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