Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::unique_ptr< T > Class Template Reference

#include <unique_ptr.hpp>

Public Types

typedef Tpointer
 

Public Member Functions

 unique_ptr (pointer t=nullptr)
 
 unique_ptr (unique_ptr &&m)
 
 ~unique_ptr ()
 
 operator bool () const
 
unique_ptroperator= (nullptr_t)
 
unique_ptroperator= (unique_ptr &&o)
 
pointer operator-> () const
 
Toperator* () const
 
void reset (pointer v)
 
pointer release ()
 

Friends

bool operator== (const unique_ptr &p, nullptr_t)
 
bool operator!= (const unique_ptr &p, nullptr_t)
 

Detailed Description

template<typename T>
class fc::unique_ptr< T >

Definition at line 8 of file unique_ptr.hpp.

Member Typedef Documentation

◆ pointer

template<typename T >
T* fc::unique_ptr< T >::pointer

Definition at line 11 of file unique_ptr.hpp.

Constructor & Destructor Documentation

◆ unique_ptr() [1/2]

template<typename T >
fc::unique_ptr< T >::unique_ptr ( pointer t = nullptr)
inlineexplicit

Definition at line 13 of file unique_ptr.hpp.

13:_p(t){}

◆ unique_ptr() [2/2]

template<typename T >
fc::unique_ptr< T >::unique_ptr ( unique_ptr< T > && m)
inline

Definition at line 15 of file unique_ptr.hpp.

16 :_p(m._p){ m._p = nullptr; }

◆ ~unique_ptr()

template<typename T >
fc::unique_ptr< T >::~unique_ptr ( )
inline

Definition at line 18 of file unique_ptr.hpp.

18{ delete _p; }

Member Function Documentation

◆ operator bool()

template<typename T >
fc::unique_ptr< T >::operator bool ( ) const
inline

Definition at line 20 of file unique_ptr.hpp.

20{ return _p != nullptr; }

◆ operator*()

template<typename T >
T & fc::unique_ptr< T >::operator* ( ) const
inline

Definition at line 43 of file unique_ptr.hpp.

43{ return *_p; }

◆ operator->()

template<typename T >
pointer fc::unique_ptr< T >::operator-> ( ) const
inline

Definition at line 42 of file unique_ptr.hpp.

42{ return _p; }

◆ operator=() [1/2]

template<typename T >
unique_ptr & fc::unique_ptr< T >::operator= ( nullptr_t )
inline

Definition at line 31 of file unique_ptr.hpp.

32 {
33 delete _p; _p = nullptr;
34 }

◆ operator=() [2/2]

template<typename T >
unique_ptr & fc::unique_ptr< T >::operator= ( unique_ptr< T > && o)
inline

Definition at line 36 of file unique_ptr.hpp.

37 {
38 fc_swap( _p, o._p );
39 return *this;
40 }
void fc_swap(T &a, T &b)
Definition utility.hpp:211
Here is the call graph for this function:

◆ release()

template<typename T >
pointer fc::unique_ptr< T >::release ( )
inline

Definition at line 49 of file unique_ptr.hpp.

50 {
51 auto tmp = _p;
52 _p = nullptr;
53 return tmp;
54 }

◆ reset()

template<typename T >
void fc::unique_ptr< T >::reset ( pointer v)
inline

Definition at line 45 of file unique_ptr.hpp.

46 {
47 delete _p; _p = v;
48 }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

template<typename T >
bool operator!= ( const unique_ptr< T > & p,
nullptr_t  )
friend

Definition at line 26 of file unique_ptr.hpp.

27 {
28 return p._p != nullptr;
29 }
const mie::Vuint & p
Definition bn.cpp:27

◆ operator==

template<typename T >
bool operator== ( const unique_ptr< T > & p,
nullptr_t  )
friend

Definition at line 21 of file unique_ptr.hpp.

22 {
23 return p._p == nullptr;
24 }

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