TGUI 1.11
Loading...
Searching...
No Matches
tgui::CopiedPtr< T > Class Template Reference

Copyable smart pointer template. More...

#include <TGUI/CopiedPtr.hpp>

Public Member Functions

 CopiedPtr ()
 Default constructor that initializes the object to a nullptr.
 CopiedPtr (std::nullptr_t)
 Constructor that accepts a nullptr as parameter.
template<typename... Args>
 CopiedPtr (CopiedPtrEmplaceTag, Args &&... args)
 Constructor that creates a new object.
 CopiedPtr (const CopiedPtr &other)
 Copy constructor.
template<typename U>
 CopiedPtr (const CopiedPtr< U > &other)
 Copy constructor that takes a pointer to a derived object.
 CopiedPtr (CopiedPtr &&other)
 Move constructor.
template<typename U>
 CopiedPtr (CopiedPtr &&other)
 Move constructor that takes a pointer to a derived object.
void swap (CopiedPtr &other)
 Exchanges the values of *this and other.
CopiedPtroperator= (const CopiedPtr &other)
 Copy assignment operator.
template<typename U>
CopiedPtroperator= (const CopiedPtr< U > &other)
 Copy assignment operator for a pointer to a derived object.
CopiedPtroperator= (CopiedPtr &&other)
 Move assignment operator.
template<typename U>
CopiedPtroperator= (CopiedPtr< U > &&other)
 Move assignment operator for a pointer to a derived object.
T & operator* ()
 Dereferences the pointer.
T * operator-> () const
 Dereferences the pointer for member access.
 operator bool () const
 Returns whether the pointer differs from a nullptr.
T * get () const
 Returns a raw pointer to the underlying object.
void reset ()
 Reset the pointer to a nullptr.

Detailed Description

template<typename T>
class tgui::CopiedPtr< T >

Copyable smart pointer template.

The smart pointer behaves as a normal value (i.e. copying the pointer also copies the underlying value), but this object can also represent a nullptr.

Constructor & Destructor Documentation

◆ CopiedPtr()

template<typename T>
template<typename... Args>
tgui::CopiedPtr< T >::CopiedPtr ( CopiedPtrEmplaceTag ,
Args &&... args )
inline

Constructor that creates a new object.

This constructor is used by the makeCopied function, which is the intended way to construct a CopiedPtr.


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