Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TAnyPtr< IS_CONST > Class Template Referencefinal

A type-safe, lightweight wrapper for any raw pointer type. Using std::any with a raw pointer type could achieve similar functionality. However, this class is dedicated for raw pointers and is guaranteed to have no dynamic allocation. More...

#include <TAnyPtr.h>

Public Member Functions

 TAnyPtr ()
 
 TAnyPtr (std::nullptr_t ptr)
 
template<typename T >
 TAnyPtr (T *ptr)
 
template<typename T >
auto * get () const
 
 operator bool () const
 
template<typename T >
 operator T* () const
 

Detailed Description

template<bool IS_CONST>
class ph::TAnyPtr< IS_CONST >

A type-safe, lightweight wrapper for any raw pointer type. Using std::any with a raw pointer type could achieve similar functionality. However, this class is dedicated for raw pointers and is guaranteed to have no dynamic allocation.

Constructor & Destructor Documentation

◆ TAnyPtr() [1/3]

template<bool IS_CONST>
ph::TAnyPtr< IS_CONST >::TAnyPtr ( )
inline

◆ TAnyPtr() [2/3]

template<bool IS_CONST>
ph::TAnyPtr< IS_CONST >::TAnyPtr ( std::nullptr_t ptr)
inline

◆ TAnyPtr() [3/3]

template<bool IS_CONST>
template<typename T >
ph::TAnyPtr< IS_CONST >::TAnyPtr ( T * ptr)
inline

Member Function Documentation

◆ get()

template<bool IS_CONST>
template<typename T >
auto * ph::TAnyPtr< IS_CONST >::get ( ) const
inline

◆ operator bool()

template<bool IS_CONST>
ph::TAnyPtr< IS_CONST >::operator bool ( ) const
inline

◆ operator T*()

template<bool IS_CONST>
template<typename T >
ph::TAnyPtr< IS_CONST >::operator T* ( ) const
inline

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