cecko
Public Member Functions | Friends | List of all members
cecko::safe_ptr< E, DF > Class Template Reference

Safe pointer to E. More...

#include <ckir.hpp>

Public Member Functions

 safe_ptr (std::nullptr_t)
 
template<typename E2 , typename DF2 , std::enable_if_t< std::is_convertible_v< E2 *, E * >, bool > = true>
 safe_ptr (const safe_ptr< E2, DF2 > &b)
 
 safe_ptr (E *p)
 
 operator E* () const
 
 operator bool () const
 
E & operator* () const
 
E * operator-> () const
 

Friends

bool operator== (const safe_ptr &a, const safe_ptr &b)
 
bool operator!= (const safe_ptr &a, const safe_ptr &b)
 

Detailed Description

template<typename E, typename DF = safe_default<E>>
class cecko::safe_ptr< E, DF >

Safe pointer to E.

No crashes: When the value is nullptr, * and -> returns a dummy object responding to all member functions. No random values: Initialized to nullptr. Automatic conversion to E*. Explicit conversion from E*.


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